Junit tab not displaying results properly
I'm using Chef's Inspec to produce a junit results file that is included in the results via the XML reports build feature. TeamCity version 2017.1.5 (build 47175)
Inspec's file looks like
<testsuites>
<testsuite name='tests from {:path=>"D:/TeamCity/AgentSmith/work/9511c2fdf3929cf8/cookbooks/mycookbook/test/integration/roleAppServer"}' tests='30' failed='0'>
<testcase name='Powershell stdout should match /Name : My Ports\r\n/' class='firewall' time='0.915966'/>
<testcase name='Powershell stdout should match /name : Tools\s*path : D:\\Tools/' class='directories' time='0.0'/>
</testsuite>
</testsuites>
TeamCity doesn't support the class attribute - it wants classname. I do a transform on the file to handle this.
The Tests tab's class view has entries
<no class> (tests from {:path=>"D:/TeamCity/AgentSmith/work/9511c2fdf3929cf8/cookbooks/mycookbook/test/integration/roleAppServer"}: firewall.Powershell stdout should match /Name)
<no class> (tests from {:path=>"D:/TeamCity/AgentSmith/work/9511c2fdf3929cf8/cookbooks/mycookbook/test/integration/roleAppServer"}: directories.Powershell stdout should match /name : Tools\s*path)
CSV download correctly gives
tests from {:path=>"D:/TeamCity/AgentSmith/work/9511c2fdf3929cf8/cookbooks/mycookbook/test/integration/roleAppServer"}: firewall.Powershell stdout should match /Name : My Ports\r\n/
tests from {:path=>"D:/TeamCity/AgentSmith/work/9511c2fdf3929cf8/cookbooks/mycookbook/test/integration/roleAppServer"}: directories.Powershell stdout should match /name : Tools\s*path : D:\\Tools/
So it looks like the UI is not being fed the correct data. Some class names are coming through correctly. The fact that the case names have colons in suggests you're splitting strings on them for some reason.
Please sign in to leave a comment.
I guess this is related to https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity where it describes the format for writing test results to the console:
The colons in the suite name are obviously not being escaped when the XML is parsed in.
Hi Richard,
I'm not really sure that that article is really linked (although I can't currently discard it either), as the Build Script interaction basically passes the data back to the server, doesn't publish it in the UI directly. Could you please create an issue in our tracker and attach a sample XML file? https://youtrack.jetbrains.com/issues/TW
Thanks in advance