Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xUnit dotnet test CLi to output to NUnit xml so that Bamboo can read the results

We are starting a new .net core project and we are just setting up Bamboo to build our project and run the tests and so my question is:

Is there a way that we can use the xunit dotnet test CLi test runner to output in NUnit format?

Currently we have: "dotnet test -xml TestResults.xml" to run our tests which works great except we can't get the results in Bamboo.

Or does anyone have an alternative that would work for us?

like image 602
Brendan Avatar asked Sep 17 '16 03:09

Brendan


2 Answers

For those interested, .NET Core SDK 2.0 not longer supports the -xml option, but it does support --logger which can be used to select specific output formats including MSTest (.trx), which is supported by Bamboo.

Example invocation:

dotnet test --logger "trx;LogFileName=abc.trx"

Note: abc.trx can be a relative or absolute path, including ellipsis.

like image 195
Jack Ukleja Avatar answered Oct 02 '22 21:10

Jack Ukleja


I have created a plugin for parsing xunit results in bamboo and published on the atlassian marketplace.

It should support v1, v2 and dotnet test outputs for xunit.

https://marketplace.atlassian.com/plugins/com.wwwlicious.xunit.xunit/server/overview

hope this helps.

like image 34
Scott Mackay Avatar answered Oct 02 '22 23:10

Scott Mackay