Skip to content

Ensure that when .serialized is applied to a parameterized @Test func, its test cases are serialized #1188

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 1 commit into from
Jun 30, 2025

Conversation

stmontgomery
Copy link
Contributor

@stmontgomery stmontgomery commented Jun 30, 2025

This fixes a regression introduced in the changes for #901. When .serialized is applied directly to a parameterized @Test function, not to a containing suite, its test cases are no longer serialized. This PR resolves and restores the original behavior by ensuring there is a non-nil scope provider returned for the test function.

Checklist:

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

Fixes rdar://154529146

…, its test cases are serialized

Fixes rdar://154529146
@stmontgomery stmontgomery added this to the Swift 6.x (main) milestone Jun 30, 2025
@stmontgomery stmontgomery self-assigned this Jun 30, 2025
@stmontgomery stmontgomery requested a review from grynspan as a code owner June 30, 2025 19:08
@stmontgomery stmontgomery added the bug 🪲 Something isn't working label Jun 30, 2025
@stmontgomery stmontgomery added traits Issues and PRs related to the trait subsystem or built-in traits parameterized-testing Related to parameterized testing functionality labels Jun 30, 2025
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@briancroom briancroom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@stmontgomery stmontgomery merged commit 3440898 into swiftlang:main Jun 30, 2025
3 checks passed
@stmontgomery stmontgomery deleted the serialized-test-func branch June 30, 2025 21:16
stmontgomery added a commit that referenced this pull request Jun 30, 2025
…func, its test cases are serialized (#1190)

- **Explanation**: This fixes a regression when `.serialized` is applied
directly to a parameterized `@Test` function, not to a containing suite,
its test cases are no longer serialized.
- **Scope**: Affects the `.serialized` trait when applied to `@Test`
functions, specifically, not to suite types.
- **Issues**: rdar://154529146
- **Original PRs**: #1188
- **Risk**:
  <!--
  The (specific) risk to the release for taking the changes.
  -->
- **Testing**: New regression test added
- **Reviewers**: @suzannaratcliff, @briancroom, @grynspan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working parameterized-testing Related to parameterized testing functionality traits Issues and PRs related to the trait subsystem or built-in traits
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants