Add support for `dotnet test` to have JUnit style output
See original GitHub issueFrom @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:
- Created 5 years ago
- Reactions:7
- Comments:10 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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
Gotcha, thanks!