fix(xcresult): stop dropping nested test suites - #1183
Open
dfrankland wants to merge 1 commit into
Open
Conversation
A suite nested inside another suite, and every test it declared, was silently
discarded. The traversal took only a suite's direct `Test Case` children, so a
`Test Suite` child was never visited.
The tests did not merely go missing — their results went with them. Against a
swift-testing bundle with a nested suite, the pre-fix traversal emits
tests="2" failures="0"
where the correct output is `tests="4" failures="1"`, so a run containing a
failing test reported a clean bill of health.
JUnit has no nested `<testsuite>`, so a nested suite now becomes one of its own
under a dot-qualified name (`Bundle.Outer.Inner`) — the convention the bundle
prefix already used. The change is additive: an outer suite with no direct cases
still emits its own `<testsuite>` exactly as before, and the inner ones appear
alongside it.
No existing expected JUnit moves, because no fixture in `tests/data/` had a
nested suite — which is why this went unnoticed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
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.
Independent bug fix, no stack. Found while working on #1178 but unrelated to it — this is in the shared JUnit traversal, so it fixes the default path with no language server involved.
The bug
A suite nested inside another suite, and every test it declared, was silently discarded. The traversal took only a suite's direct
Test Casechildren, so aTest Suitechild was never visited.The tests did not merely go missing — their results went with them. Against a swift-testing bundle with a nested suite, the pre-fix traversal emits
where the correct output is
tests="4" failures="1". So a run containing a failing test reported a clean bill of health.The fix
JUnit has no nested
<testsuite>, so a nested suite now becomes one of its own under a dot-qualified name (Bundle.Outer.Inner) — the convention the bundle prefix already used.Additive: an outer suite with no direct cases still emits its own
<testsuite>exactly as before, and the inner ones appear alongside it.Testing
nested_suites_are_flattened_rather_than_droppedasserts the full(suite, [cases])structure. Reverting the recursion fails it.No existing expected JUnit moves — no fixture in
tests/data/had a nested suite, which is why this went unnoticed. Full suite: 38 unit, 21 integration.🤖 Generated with Claude Code