Conversation
Swift Testing prints the bare function name for tests declared without a display name, e.g. `✔ Test passes() passed after 0.001 seconds.`. The result and issue parsers only accepted quoted names, so these lines were ignored: passes, failures and failure locations for `@Test func name()` tests never reached progress or the summary. Accept bare names in result and issue lines, parse quoted names in the arrow skip format, and accept any argument label in parameterized issue lines (`with 1 argument x → 2`), not only arguments named `value`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
Swift Testing only quotes a test's name when the test has a display name. For a test written as
@Test func fails(), it prints the bare function name:I captured this from
xcodebuild test(Xcode 26, Swift Testing 1501) and fromswift test(Swift 6.2.3).parseSwiftTestingResultLineandparseSwiftTestingIssueLineonly accept quoted names (Test "(.+)"), so every line above except the skip is dropped as unrecognized. The skip is dropped too, because the arrow skip format only accepts an unquoted name. Parameterized issue lines are also missed unless the argument is literally namedvalue: the pattern expectswith 1 argument value → ..., but real output iswith 1 argument x → 2.The effect is clearest with
swift_package_test, which has no xcresult to fall back on. I ran a package with one passing test, one failing@Test funcwith 3 issues, one failing display-named test, a parameterized test with one failing case, and two skipped tests. Onmain, 2 of the 6 test results are recognized and only one failure diagnostic is emitted (the display-named test). The failures infails()andparam(x:)have no location, and their pass/fail results never appear as test-case results.Fix
[^\s"]\S*) as well as a quoted display name. The bare form cannot matchTest run with ...summary lines, and there is a test for that.with N argument(s) <label> → <value>).With the fix, the same output gives 6 test results and all 5 failure diagnostics, with locations.
Running with parallel testing on is unaffected. In that mode xcodebuild prints only
Test case 'Suite/name()' ...lines, not the native lines, so nothing is counted twice.Tests
swift-testing-line-parsers.test.ts: bare-name passed, failed and parameterized failed results; quoted arrow skip; bare-name issue lines with and without an argument; summary lines not parsed as results.xcodebuild-event-parser.test.ts:parses Swift Testing results for tests without display namesreplays the captured xcodebuild lines.The new tests fail on
d13ff0c(7 failed / 59 passed in the two files) and pass with the fix (66/66). The full unit suite passes (243 files, 2599 tests).npm run build,npm run typecheck,npm run lint(0 errors) andprettier --checkon the changed files also pass. I did not run the snapshot and smoke suites.This touches the same parser area as #541 but is independent of it. The two PRs only conflict in
CHANGELOG.md.I wrote this change with AI assistance (Claude) and checked it against real
xcodebuild testandswift testoutput.