I used NUnit Runner in Atlassian Bamboo (latest version) with NUnit 2 but after upgrading to NUnit 3 it is no longer working. It appears something changed with the command line in NUnit 3. Anyone know how to make NUnit 3 work in Atlassian Bamboo? Or could the NUnit devs consider backward compatibility for this breaking change?
I get the following error:
Invalid argument: -xml=TestResults-Rev_02f5436a0a70cd539bd3b77218fb48cbe3262954-Build_12.xml
The nunit3-console.exe program is a text-based runner for listing and running our tests from the command-line. It is able to run all NUnit 3.0 or higher tests natively and can run NUnit 2. x tests if the v2 driver is installed.
The simplest solution is to create a bat file that replaces -xml argument to --result.
Create a bat file in Nunit runner directory (by default C:\Program Files (x86)\NUnit.org\nunit-console) and copy the fallowing lines into it.
@echo off
SET "var=%*"
CALL SET var=%%var:-xml=--result%%
nunit3-console.exe %var%;format=nunit2
Then use the bat file address as Nunit runner executable path.
Hopefully the Atlassian team will update Bamboo to support NUnit 3 soon. I would suggest submitting a request with them. The NUnit team will be happy to help them if they have any questions.
NUnit will not support a backward's compatible command line, but you can likely get Bamboo working now by modifying the test execution task.
I haven't used Bamboo, but on AppVeyor, we had to disable automatic test detection and running, then instead of using the built in NUnit task, we execute the new nunit3-console directly, passing in the test assemblies.
If Bamboo parses and displays the test results, you can instruct NUnit 3 to produce XML in the version 2 format with the command --result=TestResults.xml;format=nunit2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With