Configure your build server
On the build server, just NuGet the runner:
nuget.exe xunit.runner.consoleThe Bamboo cannot parse xUnit output. It can handle the nUnit output nd the xUnit has an option to print results in the nUnit format. So, create a simple
@echo off @rem xunit runner for Bamboo if "%2"=="" ( echo Usage: test.dll report.xml exit /b 1 ) if not exist %~dp2 mkdir %~dp2 "c:\path\to\xunit.runner.console.2.1.0\tools\xunit.console.exe" %1 -nunit %2
Then go to your Bamboo Administration - Agents Summary and choose your agent. Add a new capability:
To add the xUnit to you plan's job, just add the Command task after the project build (e.g. MSBuild, or NAnt). I expect you have a module MyProjectTests in your solution. Then configure the xUnit task:
|Working sub directory||
The final trick is to add the NUnit Parser task, just take care to put is as the final task:
|NUnit Test Results File/Directory||
The bamboo logic is, that:
- Any task fails, and no test result is found, it assumes the compilation error has occurred.
- Any task fails, and a test result is found, it assumes a test has failed.
- All tasks pass, the build is OK. If the test results are found, they are picked up.