Skip to content

Merge 'main' branch to 'release/6.2' #1141

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 6 commits into from
Jun 7, 2025

Conversation

stmontgomery
Copy link
Contributor

This merges the main branch into the release/6.2 branch.

Note: The Swift Testing project will be periodically performing "backwards" merges like this for a period which extends beyond the date when the 6.2 branches were cut, since nearly all contributions are intended to be included in the 6.2 release.

Once this PR has been merged, I will adjust the milestones on the PRs included in this merge to be 6.2 wherever appropriate.

Checklist:

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

)

Revert the workaround added in swiftlang#1100, since the Swift compiler issue has
been resolved and newer `main` development snapshot toolchains have
become available with the fix.

This reverts commit a82d0a8.

### 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.
…rt and showcase helper pattern (swiftlang#1133)

This expands a few places where we document parameterized testing APIs
to mention `try`/`await` support and showcase a common pattern for
sharing arguments between multiple tests.

### Modifications:

- For each `@Test` macro which accepts arguments, mention that `try` and
`await` are supported and that arguments are lazily evaluated.
- In the "Implementing parameterized tests" article, add a new section
titled "Pass the same arguments to multiple test functions" showcasing
the pattern of extracting common arguments to a separate property.
- Add a [`> Tip:`
callout](https://www.swift.org/documentation/docc/other-formatting-options#Add-Notes-and-Other-Asides)
within that new article section mentioning `try`/`await` support.

### 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.

Fixes rdar://130929060
…acros (swiftlang#1134)

Acknowledge unsafe API usages from various testing library macros such
as `@Test`, `@Suite`, and `#expect(processExitsWith:)` which are
revealed in modules which enable the new opt-in strict memory safety
feature in Swift 6.2.

### Motivation:

This fix allows clients of the testing library to enable [SE-0458:
Opt-in Strict Memory Safety
Checking](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0458-strict-memory-safety.md)
if they wish and avoid diagnostics from the testing library macros in
their modules. These warnings generally looked like this, before this
fix:

```
⚠️ @__swiftmacro_22MemorySafeTestingTests19exampleTestFunction33_F2EA1AA3013574E5644E5A4339F05086LL0F0fMp_.swift:23:14: warning: expression uses unsafe constructs but is not marked with 'unsafe'
  Testing.Test.__store($s22MemorySafeTestingTests19exampleTestFunction33_F2EA1AA3013574E5644E5A4339F05086LL0F0fMp_25generator1e3470c498e8fe35fMu_, into: outValue, asTypeAt: type)
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

### Modifications:

- Add test file to reproduce the new diagnostics. It's in a new module
which opts-in to strict memory safety, and marked as a dependency of
`TestingTests`.
- Add `unsafe` keyword in the appropriate places in our macros to
acknowledge the existing unsafe usages.

### 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.

Fixes: rdar://151238560
This applies a workaround to fix macOS builds (including CI) which began
failing due to a Swift compiler regression which is expected to be
resolved by swiftlang/swift#82034.

### 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.
…ial-case system issues (swiftlang#1136)

Refinements to `IssueHandlingTrait` based on
[pitch](https://forums.swift.org/t/pitch-issue-handling-traits/80019)
feedback.

### Modifications:

- Rename the `transformIssues(_:)` function to `compactMapIssues(_:)` to
align better with `filterIssues(_:)`.
- Ignore issues for which the value of `kind` is `.system`.
- Prohibit returning an issue from the closure passed to
`compactMapIssues(_:)` whose `kind` is `.system`.
- Adjust documentation and tests.

### 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.
@stmontgomery stmontgomery added this to the Swift 6.2 milestone Jun 7, 2025
@stmontgomery stmontgomery self-assigned this Jun 7, 2025
@stmontgomery stmontgomery requested a review from grynspan as a code owner June 7, 2025 11:50
@stmontgomery stmontgomery added the integration ⚙️ Integrating work to release branches label Jun 7, 2025
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery stmontgomery merged commit 610b2bc into swiftlang:release/6.2 Jun 7, 2025
3 checks passed
@stmontgomery stmontgomery deleted the main-6.2-merge branch June 7, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration ⚙️ Integrating work to release branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants