TeamCity - stop building if testing fails

Is it possible to stop TeamCity assembly (the entire assembly, i.e. will not perform the next steps) when the unit test fails? Ideally, I would also like him to complete the current step, which in my case would be the Nunit Test Runner. In my circumstances, it makes no sense to continue building if one unit test fails. I looked at Failure Conditions, but I don’t think they are applicable as the build continues to work.

Requested Function: http://youtrack.jetbrains.com/issue/YTF-3275

+7
continuous-integration nunit teamcity build-server
source share
2 answers

You can do this with nunit-console.exe. according to the official documentation ( http://nunit.org/index.php?p=consoleCommandLine&r=2.6.2 ) it provides a / stoponerror switch that does exactly what you need.

it can also generate XML output that can be parsed by the teamity command (there is a build function for this) to populate the test tab.

+3
source share

As you noted, TeamCity cannot perform any further build steps for testing errors in NUnit tests with the execution condition "Only if the build status is successful." However, this does not stop the tests until the stage is completed.

Associated Feature Request TW-23766 .

The only workaround I can consider at this time is not to use the NUnit test runner and implement the logic inside the build script. For example, with nunit-console.exe, as Manuel noted. If you decide to follow this route, consider using TeamCity Addin for NUNit .

+6
source share

All Articles