Unit test status text when not using a sln build runner

Hello,

I want to be able to build a VS solution and run some unit tests. Normally I would use the sln2008 build runner but I need to does some 'extra stuff' before compiling the solution and running the tests (copy files around etc.).

I have written a NAnt script which compiles my solution and runs my unit tests but now I don't get build configuration status text that says "Tests passed: 1348, ignored 12" and the drop down saying which test failed. Is there any way I can this to work fomr my own build script without using the sln2008 runner?

Thanks,

Andy

5 comments

Does that script works from console?

Have you set failonfailure=true attribute for NUnit task.

Please attach logs from that build.

Thanks!

0

I think I have not explained my problem properly, let me try again.

My NAnt scripts runs fine but I am using the NAnt NUnit tasks so the number of tests passed/failed/ignored does not appear in the build configuration status display (which it does if I run my unit tests using the sln2008 build runner).

Thanks,

Andy

0

Please attach latest 100 lines of the build log.

Do you use ]]> NAnt task for that?

What is the version of NUnit, NAnt, TeamCity, OS?

What is about build agent service user account?

Thanks!

0

I use the exec NAnt task becaus eI want to run the unit tests with /noshadow (the NAnt task doesn't have an option for this).

I'm using NUnit 2.4.7, NAnt 0.85, TeamCity 3.1.1 and Windows XP.

The end of the build log is (it is lots of assemblies being run as untit tests like this):

: exec (1s)
: Starting 'C:\BuildAgent\work\c1b8cb210637732b\Code
bin\release\nunit-console-x86.exe ( "C:\BuildAgent\work\c1b8cb210637732b\Code\bin\release\NUnitUtils.dll" /noshadow )' in 'C:\BuildAgent\work\c1b8cb210637732b'
: NUnit version 2.4.7
: Copyright (C) 2002-2007 Charlie Poole.
: Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
: Copyright (C) 2000-2002 Philip Craig.
: All Rights Reserved.
: Runtime Environment -
: OS Version: Microsoft Windows NT 5.1.2600 Service Pack 2
: CLR Version: 2.0.50727.1433 ( Net 2.0.50727.1433 )
: ...................................N...................
: Tests run: 53, Failures: 0, Not run: 1, Time: 1.172 seconds
: Tests not run:
: 1) UnitTests.NUnitUtils._dependantOrder.SwapParentAndChildMethod2 : DependantOrder needs fixing!
: Process exit code: 0
: Build finished

0

TeamCity is unable to find any output from your test runner in general.

There are only several ways for running tests in the right way:
- use TeamCity service messages to change the build status. For detail, please have a look to http://www.jetbrains.net/confluence/display/TCD3/BuildScriptInteractionwithTeamCity
- use nunit2 task which will be replaced with call to TeamCity embedded NUnit test runner
- use TeamCity NUnit test runner from commandline. For details, please have a look to http://teamcitydev.blogspot.com/2008/05/teamcity-nunit-support-features.html. Please note, TC 3.1.1 does not have NUnit-2.4.1 and NUnit-2.4.7 test runners.
- implement your own test runner on top of XML-RPC messages transport.
- in TC 4.0 we created NUnit runner plugin which can be added to NUnit-console runner to enable tests logging to TeamCity.

I have just forgotten to mention that in case you using TeamCity NUnit runner you will receive all tests notifications on-the-fly. That would mean you do not need to wait for the end of tests run to know the first test it broken.

Thanks!

0

Please sign in to leave a comment.