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
Testcases out of order in XML file in junitreport folder when using testng #1262
Comments
@gaoqiang0306 - Can you please help add some clarity around why you feel that the order of execution if different in the xml reports will confuse the users ? Why is the order so important here ? Just curious to hear this part because I understand JUnit doesn't have dependency of tests, and so order shouldn't really matter in reports. |
@krmahadevan At the beginning, we did UT with Junit 4 and @FixMethodOrder can be used which can be used like dependency , so the order for the report was like 001,002,003, 004. Recently, QA Manager team want us move to TestNG due to more powerful, but the order in XML was random, they maybe confused why. So in my opinion, the testcases order should be the same as testng-results.xml showed, follow the order we defined in our test cases. Thanks for your support. |
I think the testng and junit reports should, at least, have the same result order. |
@juherr Done, please check. |
@krmahadevan Did you have a look on it? I think it could be a good opportunity for a |
@juherr I haven't taken a look yet. I will take a look and update. |
@juherr - Why not fix this in the current |
I had a quick look and I think the change may be as important as a rewrite. But maybe Im wrong too ;) |
@juherr - I was able to bring the ordering with just introducing a |
I'm not sure a sort on priority will be enough. And the request is to have the same order than the testng report. (I didn't check how it is sorted there) |
@juherr - I don't think that the user is expecting a parity between the TestNG reports and the JUnit reports in terms of order. I think the user is basically expecting that the JUnit reports honor the priority (because that is what is essentially determining the execution order) and list out test cases in the same order of execution. Also looking at the screenshot, the emailable report (which is TestNG report) seems to be ordering the tests alphabetically (within each test class of-course) See here The contents of Since the user explicitly mentions the usage of Please let me know if there's any gap here. |
@krmahadevan In fact, I think all reporters should have the same order and here it is a good opportunity to have it for the JUnit reporter. Another option could be to have the same order than JUnit itself. But don't worry, I'm just sharing my ideas and I won't block a pull request based on priority order ;) |
@juherr - Please don't get me wrong. I was only trying to ensure that I am understanding the bug properly so that I can fix it correctly :)
That sounds like a fair ask. I was thinking that maybe its time we provided some mechanism wherein the ordering of methods is something that our end users can provide to us as a comparator and we just use that to honor the sorting of methods (within the scope of a test class) based on their order. This I thought would be extremely useful for people who want to tweak the listing of methods in the default reports (over which our users currently don't have much of a control since they are auto-wired) |
@krmahadevan @juherr Thanks for your help, another question, how can i get the latest code using maven, which version i needed? |
@gaoqiang0306 - I am not sure if the snapshot versions of TestNG are being published anywhere. |
Snapshots are available on https://oss.sonatype.org/content/repositories/snapshots/ |
@krmahadevan Yes, the version must be updated in gradle and kobalt files ;) |
ok. So I figured out that it should be changed here. Next question is.. what should be the new version ? :) |
@krmahadevan 6.10.1 looks good |
@krmahadevan And don't forget https://github.com/cbeust/testng/blob/master/kobalt/src/Build.kt#L18 if you want to update the value ;) |
Yes, 6.10.1 is a good default.
…--
Cédric
On Tue, Dec 13, 2016 at 4:33 AM, Julien Herr ***@***.***> wrote:
@krmahadevan <https://github.com/krmahadevan> And don't forget
https://github.com/cbeust/testng/blob/master/kobalt/src/Build.kt#L18 if
you want to update the value ;)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1262 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFoonSiQsTAgsdJSddS-wcxEbJONaTPks5rHpCDgaJpZM4LD0LD>
.
|
Thanks. I fixed this and sent a pull request #1274 |
@krmahadevan @juherr @cbeust thanks, all of you guys. my issue was fixed so quickly, nice work!!! |
TestNG Version 6.9.10 and 6.9.13.6
Expected behavior
testcase should be as the same order as the test cases run
Actual behavior
the order random each time and testng-results.xml was correct which cannot used for junit report when using ant and maven
Is the issue reproductible on runner?
Test case sample
Part of my testcases
but the junitreports was showed not in order as below
I want to use ant and XML files in junitreport folder to generate a html, if the order random each time, it
will be confused when the report were saw by others
testng report
The text was updated successfully, but these errors were encountered: