I have installed TeamCity
for CI on one of our server and have managed to get it working upto a point where, if someone commits in SVN, TeamCity
picks up the changes and build the code at its end.
Now I am trying to add our Unit Test
project in TeamCity
so that we also get to know if any Test fails when we commit our code.
We have a Test Project (named TeamTest) and all the Unit Tests
are written in it, now when I try to add this project as a Build Step
in TeamCity
, what Runner Type
should I choose?
Do I need to install some other software on my build server to get it working?
What path should I put in Run tests from
if runner type is chosen as NUnit
or MSTest
? (Is it dll of project TeamTest)
Apologies, if these are dumb question but I have tried searching internet, asking TeamCity blogs but cant find answer to my question.
The runner type you require for your unit test project is completely dependent on what testing framework they are written for.
If they are written for NUnit, you will choose the NUnit runner type, for MSTest, you'd choose that runner.
As for setup, you simply include the output of your test project libraries in the List assembly files include list. Remember you can use wildcards in this form so if you had several unit test projects with a specific naming schema, you could include all of these simply by using the following:
**\*Tests.dll
This will include all files named *something*Tests.dll in all folders. You can of course hardcode your individual case so as an example that may be similar to the following:
TeamTests\bin\Release\TeamTest.dll
In my experience, the rest of the options can be left as default. TeamCity will then run all the tests it finds in the found assemblies and will automatically fail the build on a single test failure.
As for external software; if you are running tests with the MSTest runner, the build server will need the MSTest binaries available to it. The easiest way to achieve this is by installing Visual Studio on the build server but if you do not want the extra bloat, you can follow the steps described here to install MSTest without Visual Studio.
If however you have chosen NUnit as your testing framework, no external software is required as NUnit comes bundled with TeamCity.
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