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
JENKINS-42438 Correctly calculate test class duration. #66
Conversation
This reverts some changes by #35 , maybe it's better to set the duration to re-sum of test cases only when there are multiple classes in a test suite? or add a configure option? |
Thanks for your input! :) In my opinion #35 introduced a bug and the person reporting JENKINS-42438 apparently has the same issue. I am afraid of adding even more complexity, like deciding whether a test suite has multiple classes and dynamically having different behaviours in ClassResult.tally() as a result. Of course, if those changes of #35 also fixed a bug themselves when that would be different. @jmarnold1021 could you please chime in on the class duration changes you introduced with #35? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced this is a right fix. It just reverts the breaking change (though it could be a proper hotfix). IMHO it would be better to have a proper parsing of floats instead
In what way is the issue related to parsing floats so that I could look into that? Btw. do you have a link to the JUnit XML specification? I am probably just too darn blind to find it. |
When running Android tests the <testsuite> in the generated xml file can contain multiple classes. Thus setting the test class duration to the value of the test-suite is wrong. Instead the class duration is now calculated as sum its test cases. This is the same way it was done before jenkinsci#35 was merged. Reverting parts of both jenkinsci#35 and jenkinsci#54 did not break any existing tests.
Here is a good thread about processing thousand separators via The discussion is not so motivating though. The format depends on the locale of the input file, and I am not sure how to extract it reliably from XML. |
I am not sure how this PR is related to parsing floats. The existing code assumes that one testsuite always represents one class. |
@mfuchs I wonder if it might make sense to use the |
@oleg-nenashev can you please re-review this PR? I don't think that your review comment applies here as I never parse floats. |
@abayer I am not sure what the benefit of the added complexity would be. |
@olivergondza Can you please also review this PR? |
The way I understand it is the And this appears what the fix is trying to achieve. @abayer, I do not see why that would not work but it is more elaborate compared to ignoring @oleg-nenashev, please elaborate on how float parsing is related. We suspect that it is not... |
@abayer, any comments? I am tempted to merge this... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me!
When running Android tests the in the generated xml file
can contain multiple classes.
Thus setting the test class duration to the value of the test-suite is wrong.