Fix JUnit output for assertion-free test cases - #3187
Open
Boulea7 wants to merge 1 commit into
Open
Conversation
Emit a testcase for executed test cases whose section tree would otherwise produce no JUnit testcase. Count the suite tests from emitted testcase nodes so the declared count matches the XML output. Fixes catchorg#2856 Assisted-by: OpenAI Codex
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## devel #3187 +/- ##
==========================================
- Coverage 91.25% 91.24% -0.01%
==========================================
Files 204 204
Lines 8965 8986 +21
==========================================
+ Hits 8181 8199 +18
- Misses 784 787 +3 🚀 New features to boost your workflow:
|
This comment was marked as spam.
This comment was marked as spam.
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
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.
Description
The JUnit reporter currently omits an executed test case when it completes without assertions. This makes its result disagree with the console reporter and can leave JUnit consumers with no
<testcase>node even though the test ran.This change emits a
<testcase>when an executed test would otherwise produce none. The suitetestsattribute is derived from the testcase nodes written by the reporter, so the declared count matches the XML output. The fallback is limited to an otherwise empty section tree, which prevents assertion-free section and generator output from receiving a duplicate root testcase.Validation
GitHub Issues
Fixes #2856
AI assistance
OpenAI Codex assisted with implementation and test preparation.