Repository navigation
fix: name Swift Testing tests under their whole suite path - #42
Merged
Merged
Conversation
A test in a nested suite was recorded, reported and matched against the skip list under its innermost suite alone (`Inner` for `Outer/Inner/b()`). The result bundle and xcodebuild's -only-testing/-skip-testing name it by the whole path, which Tuist now records too, so its evidence didn't join to the test and the skip list couldn't name it. The trait now names every suite the test is nested in, outermost first and separated by `/`, and the skip list reads a line's first component as the module, its last as the test and everything between as the suite. XCTest names are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The skip list now joins everything between the module and the test into the suite, and the trait looks tests up by the same joined identifier, so `Module/Suite/a/b` matches a test whose display name is `a/b`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…suite Until Tuist's server records nested suites whole, it names a nested test by its innermost suite (`Module/Inner/name()`), so a skip list it writes would stop matching once the trait looks tests up by their full path. test_coverage_attribution_is_skipped() now also tries the innermost suite, so the same release works with skip lists of either form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Records it under its whole path and skips it whether the list names that path or only its innermost suite, so the path handling has no fixed depth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 13, 2026
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.
What changed
CoverageAttributionTrait): the suite is now every suite the test is nested in, outermost first and joined with/(test.id.nameComponents.dropLast()). Before, it was only the innermost suite (components[count - 2]).nameComponentsnever includes the module (that'stest.id.moduleName), so a top-level suite isSuite, a struct nested in a struct isOuter/Inner, a suite declared inextension OuterisOuter/Inner, and a suite in anenumnamespace isNamespace/Inner. That one value feedsrecords.bin,unskippable.tsvand the skip-list lookup.load_skip_list()): the first component of a line is the module, the last is the test, and everything in between is the suite (Module/Outer/Inner/name()).test_coverage_attribution_is_skippedmatches the full path first, then the innermost suite alone (Module/Inner/name()), which is what Tuist's server writes today. A line is ignored if it has fewer than three components or an empty one. Before, any line without exactly three components was dropped. XCTest is unchanged, since class names can't contain/.records.binsuite field.Why
The result bundle and xcodebuild's
-only-testing/-skip-testingname a nested Swift Testing test by its whole path (Module/Outer/Inner/b()). Tuist used to keep only the innermost suite. It now records the fullOuter/Innerpath: it migrated its server-side test-case IDs because quarantined tests in nested suites kept running. Because this package still recordedInner:Compatibility with today's server
The server still names nested tests by their innermost suite until tuist/tuist#15645 deploys.
Module/Inner/name()line still skips the nested test, as it does today, and aModule/Outer/Inner/name()line skips it once the server sends full paths. The fallback keeps one ambiguity that already exists today: a line for a top-levelInnersuite also matches a same-named test in a nestedOuter.Inner.Outer/Inner. The current server looks up evidence underInner, so it finds none for nested-suite tests and runs them (:no_evidence) until #15645 deploys. Nothing is wrongly skipped; nested tests lose coverage-based savings in the meantime. Top-level suites and XCTest are unaffected.Tests
Fixtures/Concurrency/Tests/ConcurrencyTests/SuitePathTests.swiftcovers a top-level suite, a struct nested in a struct, a suite nested ten levels deep, a suite in anextension, and a suite in anenumnamespace.recordsSwiftTestingTestsUnderTheirWholeSuitePath: checks that the records carry the full paths.skipsTheListedSwiftTestingTestsOfNestedSuites: full-path lines and innermost-suite lines both skip nested tests (Swift 6.3+), while a path with the wrong outer suite matches nothing. The listed flag inunskippable.tsvasserts the matching on every Swift version, including those before 6.3, where nothing is cancelled.MultiplicationTests/UnskippableMultiplicationTestsandUnskippableSwiftTestingTests/SkippableTests) to use their full paths.Validation
swift test(whole package, including the simulator UI and skip-list tests) on Xcode 26.3 / Swift 6.2.4: 14 tests passed.swift test --filter 'skipsTheListed|runsEveryTestWithoutASkipList|WholeSuitePath|OfNestedSuites'on Xcode 26.6 / Swift 6.3.3, which compiles theTest.cancelpath: passed.mise run lint: clean.🤖 Generated with Claude Code