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

I remember how it was done in the old version of Team City, in which NNnit Runner failed, so I tried to start NUnit using Running Runner.

I think that there was an option in the Command line settings to specify the type of the output file: NUnit result.xml was one of them. Thus, you can see a breakdown of the test results in the web GUI, as with NUnit Runner.

But I do not see this in the latest Team City (6.5.5). Can this be done?

PS: Before anyone asks, I can’t use Team NUnit Runner because NUnit has a bug that will be fixed in version 2.6.0 soon. The specified error does not occur when running nunit-console

+6
source share
2 answers

The functionality was still there, accidentally found while looking at a different assembly configuration. XML import is now a "build function", see:

2YMDb.jpg

+6
source

This can be done using the importdata TeamCity message, it is very useful if you run NUnit tests manually by running nunit-console.exe from an MSBuild script, for example, using the NUnit MSBuild Community Task , but keep in mind that TeamCity provides a built-in NUnit test runner, so you don’t need this low-level TeamCity script. In any case, you can import the report this way:

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

See Import XML Reports

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

+10
source

Source: https://habr.com/ru/post/901068/


All Articles