I’ve been looking at ways to run VSTS tests without using the actual Visual Studio testing framework. It all started when I wanted to integrate code-coverage in our TeamCity daily build. All the solutions I found were using the NUnit runner for this, and while I could have used mstest.exe to run the tests when I’m gathering code-coverage, I didn’t want to. Why? Well, because:
- TeamCity doesn’t use it to run the tests, so I might get different result from the regular test-run and the code-coverage test-run.
- It requires me to install Visual Studio on the server.
- It creates annoying TestResult folders.
- It requires maintaining a testrun.config file.
In essence, using mstest.exe just seems a lot more cumbersome. Still, all our tests are indeed using the VSTS attributes, so I need a way to run them “NUnit-style”, i.e. without mstest.exe. TestDriven.Net and TeamCity already seem to be doing this, but without exposing anything that I could use. Google did not help, neither. So, I turned to ask at Stackoverflow.com. After a while, an answer was received by a fellow named Bryan Cook: an addin to NUnit exist, but alas, it turns out it doesn’t support the latest NUnit version. Kindly enough, Bryan just went and fixed it. Not a trivial task, mind you, as I had a look at the code, and it seems that the NUnit API went through quite a lot of changes going into version 2.5.
Anyway, you can go over and download the addin from right here. Thanks Bryan!
On a different note, we ended up deciding to switch all our tests to NUnit at the end, but I’m sure this could come handy in the future 🙂