-
Notifications
You must be signed in to change notification settings - Fork 128
Merge 'main' branch to 'release/6.2' #1101
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
Conversation
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
Fix a small oversight in the URL of the CI status badge for Swift 6.1 Windows, which I added in swiftlang#1083. The URL points to the wrong CI server domain, so it says "Not run" instead of "Passing". ### 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.
Add withKnownIssue comments to known Issues ### Motivation: The Comment passed to withKnownIssue() is currently only used when a known issue does not occur. When a known issue does occur, it is marked isKnown but does not contain any record of the withKnownIssue() comment, making it harder to understand why the issue was considered to be known, especially if there are multiple nested withKnownIssue() calls. ### Modifications: When an issue is marked "known" by a `withKnownIssue()` call, the recorded issue will now have a new `knownIssueContext` property containing the comment passed to `withKnownIssue()` (if any). This comment will be included in the `messages` array of the `ABI.EncodedEvent` that represents the issue. If the issue is recorded within multiple nested `withKnownIssue()` calls, `knownIssueContext` corresponds to the innermost matching call. The `Issue.isKnown` setter is now deprecated and a no-op. When an error is thrown within a `withKnownIssue()` call, the `Issue` passed to the issue matcher used to have the known issue comment in `Issue.comments`. That has now been removed; Issues for thrown errors now have no comments at all when passed to the issue matcher. This matches Issues for thrown errors that occur outside of `withKnownIssue()` calls. ### 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. --------- Co-authored-by: Jonathan Grynspan <grynspan@me.com> Co-authored-by: Stuart Montgomery <smontgomery@apple.com>
This introduces a new trait type named `IssueHandlingTrait` as SPI. It allows observing, transforming, or filtering the issue(s) recorded during the test it's applied to. Here's a contrived example: ```swift @test(.transformIssues { issue in var issue = issue issue.comments.append("A comparison of two literals") return issue // Or, return `nil` to suppress the issue }) func example() { #expect(1 == 2) } ``` ### Motivation: Sometimes it can be useful to customize an issue recorded during a test. For example, you might wish to add supplemental information to it, such by adding comments. Another example of this could be adding an attachment to an issue, which was a capability mentioned as a [future direction](https://github.com/swiftlang/swift-evolution/blob/main/proposals/testing/0009-attachments.md#future-directions) in [ST-0009 Attachments](https://github.com/swiftlang/swift-evolution/blob/main/proposals/testing/0009-attachments.md). Other times, you might wish to suppress an issue which is later determined to be irrelevant or cannot be marked as a [known issue](https://swiftpackageindex.com/swiftlang/swift-testing/main/documentation/testing/known-issues). Or, you may simply want to be notified that an issue was recorded, to react to it in some other way while still recording the issue normally. ### 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. Resolves rdar://140144041
…#1097) Remove experimental status for ConditionTrait.evaluate() and add metadata ### Motivation: Now that the proposal has been accepted, the experimental tag can be removed. ### Modifications: * Removed the `@_spi(Experimental)` attribute from `ConditionTrait.evaluate()` * Added metadata to the doc comment marking it as part of Swift 6.2 ### 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.
This PR promotes exit tests to API, pending approval of the proposal at swiftlang/swift-evolution#2718. View the full proposal [here](https://github.com/grynspan/swift-evolution/blob/jgrynspan/swift-testing-exit-tests/proposals/testing/NNNN-exit-tests.md). ### 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. --------- Co-authored-by: Stuart Montgomery <smontgomery@apple.com>
This works around a macOS CI failure. A revert in the Swift compiler (in swiftlang/swift#80830) is expected to resolve it, but the release of a newer `main` development snapshot toolchain is blocked for unrelated reasons. ### 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.
Contributor
Author
|
@swift-ci please test |
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.
This merges the
mainbranch into therelease/6.2branch.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: