-
Notifications
You must be signed in to change notification settings - Fork 52
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
junitparser.py: Remove skipped
attribute from testsuites
element
#101
Conversation
@weiwei FYI |
3db4fb2
to
cca4497
Compare
skipped
attribute from testsuites
element
@EnricoMi now that you are a co-maintainer, would you mind taking a look at this PR? 😃 Thanks! |
@@ -231,7 +231,6 @@ class JUnitXml(Element): | |||
tests: total number of tests | |||
failures: number of failed cases | |||
errors: number of cases with errors | |||
skipped: number of skipped cases |
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 sure about removing this, I'll have to check some specs. At least this has to be made backward-compatible or released under a major version.
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 understand. I linked the specs I could find in the commit message / PR description.
You need jobs:
build-test:
# Python version < 3.7 requires ubuntu-20.04
runs-on: ubuntu-20.04 in |
cca4497
to
3e618d5
Compare
Codecov ReportBase: 98.00% // Head: 98.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #101 +/- ##
=======================================
Coverage 98.00% 98.00%
=======================================
Files 6 6
Lines 1253 1253
=======================================
Hits 1228 1228
Misses 25 25
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
3e618d5
to
03d56a7
Compare
So from all the specs that I could find it looks the right thing to remove skipped. Ideally, you would only want it to be removed from the written XML, but still provide the skipped-sum over contained suites, if that is easily possible. Is it? |
That's a good question. I think it might be with some refactoring, by using a class member variable instead of an |
03d56a7
to
4bbe3be
Compare
@EnricoMi I just pushed an updated commit that hopefully does what you suggested. |
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.
This way the written XML conforms to the spec while still providing the skipped sum. This reduces risk of breaking user code, but I think it still requires a major version bump.
The presence of the "skipped" attribute in the "testsuites" element makes validation against the junit/xunit2 schemas fail. Remove it so that xml output is compliant. See schemas: https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd#L139-L143 or https://github.com/pytest-dev/pytest/blob/main/testing/example_scripts/junit-10.xsd#L139-L143 as well as: https://www.ibm.com/docs/en/developer-for-zos/14.2?topic=formats-junit-xml-format Fixes weiwei#100. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
4bbe3be
to
ffc0f74
Compare
I agree with you. Is this PR plus #102 enough to justify a major version bump you think? |
Sorry I have been busy with family errands this month. \The schema I referenced was this specific one, because it was the requirement of the project I was working on, and it does need the I've been considering something like |
Excellent, I like the idea, this allows to support that varying zoo of JUnit XML schemata. And it avoids a breaking change. |
Sure! I don't think I currently have the time to spend on this, but I will try to find some. If you want to go ahead and open another PR instead I will be happy to review. |
Implemented in #108 |
The presence of the "skipped" attribute in the "testsuites" element makes validation against the junit/xunit2 schemas fail. Remove it so that xml output is compliant.
See schemas: Jenkins xunit plugin or pytest, as well as the JUnit spec.
Fixes #100.
Signed-off-by: Carles Cufi carles.cufi@nordicsemi.no