question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for `dotnet test` to have JUnit style output

See original GitHub issue

From @wordshaker on February 4, 2019 12:6

The Problem

Using CircleCI as a build tool, there are some features you can only get access to if your test output is in a JUnit format. XUnit provides a -junit argument to transform XUnit output to a JUnit style of output and it seems similar functionality used to be supported: https://stackoverflow.com/questions/39542533/xunit-dotnet-test-cli-to-output-to-nunit-xml-so-that-bamboo-can-read-the-results/47073101

I’ve tried using the --logger option in a few ways, but can’t find a way of achieving what I want without using another package.

Is it possible to use the XUnit Transforms out the box with dotnet test?

Expected behavior

  • To be able to run an argument as part of dotnet test that enables the test output to be transformed into an expected format.

Actual behavior

  • Can use the --logger argument to output to xml or trx, but the tool I’m using explicitly needs a trx with JUnit formatting

Copied from original issue: dotnet/cli#10698

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
pavelhorakcommented, Oct 5, 2020

@danjcosg to output in JUnit format you can add a reference to the JUnit Logger nuget package in your test project and then use the following command to run tests dotnet test --test-adapter-path:. --logger:junit

See more usage details: https://github.com/spekt/junit.testlogger#usage

0reactions
kendrahavenscommented, Oct 1, 2020

Gotcha, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to log dotnet test output in junit format
1 Answer 1 · Install the NuGet package to your test project: <PackageReference Include="JunitXml.TestLogger" Version="3.0.110" /> · Run the ...
Read more >
dotnet test command - .NET CLI
The dotnet test command builds the solution and runs a test host application for each test project in the solution. The test host...
Read more >
Add .Net example to Junit test reports (#32869) · Issues
Hello,. I would like to suggest an addition to the Junit reports examples. I had been looking for a way to get test...
Read more >
dotnet-xunit-to-junit 4.0.0
Transforms a xUnit.net v2 XML test results file into a JUnit test results file.
Read more >
xUnit.net - Testmo Integrations
xUnit.net can generate JUnit-style XML files, which has become a standard format to exchange test results between tools. You just need to install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found