-
Notifications
You must be signed in to change notification settings - Fork 54
Make JUnitXml.from*
methods return only JUnitXml
instances
#142
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Dec 20, 2024
Closed
167210d
to
66b0d19
Compare
e321d12
to
5ec9ccb
Compare
5ec9ccb
to
2095372
Compare
2095372
to
5cbf10d
Compare
@weiwei what are your thoughts? This is a breaking change so the upcoming v4 release would be a nice target. |
natifridman
added a commit
to natifridman/release
that referenced
this pull request
May 27, 2025
Junitparser's verify subcommand fails if there is only one test suite This can be removed when weiwei/junitparser#142 is merged
openshift-merge-bot bot
pushed a commit
to openshift/release
that referenced
this pull request
May 27, 2025
Junitparser's verify subcommand fails if there is only one test suite This can be removed when weiwei/junitparser#142 is merged
abraham2512
pushed a commit
to abraham2512/release
that referenced
this pull request
May 29, 2025
Junitparser's verify subcommand fails if there is only one test suite This can be removed when weiwei/junitparser#142 is merged
weiwei
reviewed
Jun 22, 2025
Earlier versions return a `TestSuite` instance when the root of the file / string / element is a `<TestSuite>`. | ||
A `JUnitXml` instance has already been returned by earlier versions when the root of the file / string / element is a `<TestSuites>`. | ||
|
||
If you want to create a `TestSuite` instance from a `<TestSuite>` element, use |
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 looks like a good way to preserve original behavior if needed.
weiwei
approved these changes
Jun 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For the sake of consistency,
JUnitXml.fromfile
,JUnitXml.fromstring
andJUnitXml.fromroot
should always return aJUnitXml
instance. Currently, when the root element of the XML document is a<TestSuite>
tag, it would return aTestSuite
instance. This causes confusion: #110, #111, #140.This fact affects behavior of iterating the instance (as given in the examples), it iterates
TestCase
instances, notTestSuite
instances:https://github.com/weiwei/junitparser?tab=readme-ov-file#read-and-manipulate-existing-junitxunit-xml-files
Note: This is a breaking change.
Fixes #110
Fixes #111
Fixes #140