Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process NUnit result.xml and show it in Team City Web GUI

I remember doing this in an older version of Team City in which the NUnit Runner failed, so I tried running NUnit using the Command Line Runner instead.

I think there was an option in the Command Line Runner settings which let you specify the kind of output file: NUnit result.xml was one of them. Doing this, you could see the test result breakdown in the Web GUI, just like when the NUnit Runner worked.

But I don't see this in the latest Team City (6.5.5). Can it still be done?

PS: Before anyone asks, I can't use Team City's NUnit Runner because NUnit has a bug which will be fixed in the soon to come 2.6.0 version. Said bug does not occurr when running nunit-console

like image 434
dario_ramos Avatar asked Nov 08 '11 21:11

dario_ramos


1 Answers

This could be done using importdata TeamCity message, this is really helpful when you are running NUnit tests manually executing nunit-console.exe from an MSBuild script, for instance using NUnit MSBuild Community Task, but keep in mind that TeamCity provides built in NUnit tests runner so you do not need this low level TeamCity scripting. Anyway you can import report in this way:

<Message 
         Text="##teamcity[importData type='nunit' path='...\TestResults.xml']" 
         Importance="High"/>

See Importing XML Reports

If you prefer to run code coverage, code inspection, test tools or duplicate finders directly from build script, not as a build runner, you can use the importData service messages to import generated xml reports into TeamCity.

like image 76
sll Avatar answered Oct 04 '22 18:10

sll