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

扶醉桌前 提交于 2019-11-28 03:54:36

问题


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


回答1:


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.




回答2:


The functionality was still there, found it by accident when looking at another build configuration. Importing an XML is now a "Build Feature", see:



来源:https://stackoverflow.com/questions/8057544/process-nunit-result-xml-and-show-it-in-team-city-web-gui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!