Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testng-results.xml order not preserved in junitreports/TEST-*.xml #421

Open
mauriziokg opened this issue Aug 9, 2013 · 1 comment
Open

Comments

@mauriziokg
Copy link

Today I migrated one of our projects from junit4 to testNG (version testng-6.8.5). Since I prefer the keep the layout of junitreport I use the junitreport ant task to convert the junitreports/TEST-.xml file generated by testNG into a standard junit report. I noticed that the order in the resulting junit report was wrong, even though I had observed during execution that the tests had been run in the right order. When investigating upon this, I found that test-results.xml listed the tests in the real execution order (which in my case is also the alphabetical order btw), but the corresponding junitreports/TEST-.xml file had the wrong order (random as it seems). I checked lots of documentation, problem reports, etc. but could not find this problem so I create a new ticket (sorry if I overlooked something).

@mauriziokg
Copy link
Author

mauriziokg commented Sep 3, 2013

I close this ticket because I found a solution to my problem: when calling the junitreport ant task I now use a modified style sheet junit-frames.xsl (by setting the styledir attribute of the <report> element). The modification to the stylesheet (in 6 locations) is the addition of <xsl:sort select="@name"/>, e.g.

<xsl:apply-templates select="./testcase" mode="print.test"/>

becomes

<xsl:apply-templates select="./testcase" mode="print.test">
    <xsl:sort select="&#64;name"/>
 </xsl:apply-templates>

It would however have been more easy if the order in junitreports/TEST-*.xml were preserved...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants