How to collect NUnit test results in TeamCity

I’ve been using TeamCity for some time now and I love it - It’s easy to install and use. TeamCity can also run unit tests using several test frameworks and collects data about the tests runs as long as you’re using one of the supported build scripts (e.c. NAnt or MSBuild) – from how many tests have been run to a list of problematic unit tests that tend to fail.

All of this is nice and dandy but what if you happen to use a different build script tool – one that doesn’t have TeamCity integration?

At Typemock we use FinalBuilder to create our build scripts – we run it using TeamCity “Command Line” runner by calling an executable that runs the script. The problem with this method is that TeamCity does not collect the test run information automatically – or does it?

On a closer look at the runner tab on the build configuration you’ll find this:


That’s right – TeamCity can load data from the last run – and it has support for NUnit xml report.

All is left is to configure NUnit to output the test result at the end of the run – Simple.


Tip #2

If you need to write messages from FinalBuilder just add the following JavaScript command: Action.SendLogMessage("Hello World!",stInformation)found via StackOverflow


Happy coding

Labels: ,