Getting NUnit on the fly results with TeamCity
posted by Bryan on
When running large test suites, it's useful to get results on the fly, rather than waiting until the suite completes to get results. Some of my test suites take 20, 30+ hours to complete. Here is how you can get immediate results using NUnit Console and TeamCity.
The main documentation site: http://confluence.jetbrains.net/display/TCD5/TeamCity+Addin+for+NUnit
Blog information: http://blogs.jetbrains.com/teamcity/2008/07/28/unfolding-teamcity-addin-for-nunit-secrets/
This turned out to be much easier than they indicated, but of course they try to handle multiple runners. I am using the NUnit Console runner specifically.
I added these properties to my NAnt default.build script:
<property name="teamCityDir" value="C:/TeamCity/buildAgent/plugins/dotnetPlugin/bin"/> <property name="nUnitAddinDir" value="C:/Program Files/NUnit 2.5.5/bin/net-2.0/addins"/> <property name="teamcity.dotnet.nunitaddin" value="${teamCityDir}/JetBrains.TeamCity.NUnitAddin-NUnit" />
And then this target, making sure it ran before the test suite ran.
<target name="prepareNUnitTeamCity" > <if test="${directory::exists('C:\TeamCity')}"> <echo message="Copying TeamCity Nunit files to Nunit addins directory"/> <copy todir="${nUnitAddinDir}"> <fileset basedir="${teamCityDir}" > <include name="${teamcity.dotnet.nunitaddin}-2.5.5.*" /> </fileset> </copy> </if> </target>
Done!