Skip to content

Refine type-based test discovery mechanism to use test content records. #1010

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
merged 4 commits into from
Mar 10, 2025

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Mar 10, 2025

This PR changes how we discover tests in the type metadata section to more closely align with how the test content section works. This change will allow for a smoother transition to the test content section and our use of @section by using the same underlying structures (as much as is feasible.) Client code that uses the new _TestDiscovery module will need fewer changes to adapt.

Resolves rdar://146561732.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@grynspan grynspan added enhancement New feature or request tools integration Integration of swift-testing into tools/IDEs exit-tests ☠️ Work related to exit tests labels Mar 10, 2025
@grynspan grynspan added this to the Swift 6.2 milestone Mar 10, 2025
@grynspan grynspan self-assigned this Mar 10, 2025
@grynspan grynspan closed this Mar 10, 2025
@grynspan grynspan reopened this Mar 10, 2025
This PR changes how we discover tests in the type metadata section to more
closely align with how the test content section works. This change will allow
for a smoother transition to the test content section and our use of `@section`
by using the same underlying structures (as much as is feasible.) Client code
that uses the new `_TestDiscovery` module will need fewer changes to adapt.
@grynspan grynspan force-pushed the jgrynspan/test-content-container branch from 2601a8c to 67f6c4c Compare March 10, 2025 16:50
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan requested a review from chrismiles March 10, 2025 16:53
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test macOS

@grynspan
Copy link
Contributor Author

Unclear why macOS just started failing here.

@grynspan
Copy link
Contributor Author

@swift-ci test

1 similar comment
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan requested a review from stmontgomery March 10, 2025 19:06
@grynspan grynspan merged commit c447de0 into main Mar 10, 2025
3 checks passed
@grynspan grynspan deleted the jgrynspan/test-content-container branch March 10, 2025 19:42
@grynspan
Copy link
Contributor Author

Resolves #1007.

grynspan added a commit that referenced this pull request Mar 12, 2025
…ction. (#1015)

Looks like #880 and/or #1010 caused a regression: the compiler appears
to be dead-code-stripping the classes we emit to contain test content
records. This PR changes the design back to using a protocol so that the
members we need are always covered by `@_alwaysEmitConformanceMetadata`.
This makes `_TestDiscovery` a little harder to use with legacy lookup,
but it's all experimental and eventually going to be removed anyway.

Resolves rdar://146809312.

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
@grynspan grynspan added the discovery 🔎 test content discovery label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discovery 🔎 test content discovery enhancement New feature or request exit-tests ☠️ Work related to exit tests tools integration Integration of swift-testing into tools/IDEs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants