Skip to content

Amend limited interop mode: #expect failure is always stays a failure#3250

Draft
jerryjrchen wants to merge 1 commit intoswiftlang:mainfrom
jerryjrchen:interop-amendment
Draft

Amend limited interop mode: #expect failure is always stays a failure#3250
jerryjrchen wants to merge 1 commit intoswiftlang:mainfrom
jerryjrchen:interop-amendment

Conversation

@jerryjrchen
Copy link
Copy Markdown
Contributor

Increase severity of #expect in XCTest tests for limited interop mode. For example:

func testLimitedInterop() {
    // Before: Warning "Interop failure"
    // After: Error "Interop failure"
    Issue.record("interop failure")
}

This change is motivated by the real-world challenges during migration to Swift Testing under the originally accepted proposal. This "limited" amendment (pun intended?) better addresses those needs!

Before: This had the unfortunate side effect that if you did as suggested in the proposal and switched from XCTFail() -> Issue.record(), interop effectively degraded your assertion errors to warnings.

After: you can migrate your XCTest API usage to Swift Testing and maintain the error severity of your asserts. This effectively makes it so that Swift Testing API functions "as expected" on ALL interop modes except for none.

Increase severity of #expect in XCTest tests for limited interop mode.
For example:

    func testLimitedInterop() {
        // Before: Warning "Interop failure"
        // After: Error "Interop failure"
        Issue.record("interop failure")
    }

This change is motivated by the real-world challenges during migration
to Swift Testing under the originally accepted proposal. This "limited"
amendment (pun intended?) better addresses those needs!

Before: This had the unfortunate side effect that if you did as
suggested in the proposal and switched from XCTFail() -> Issue.record(),
interop effectively degraded your assertion errors to warnings.

After: you can migrate your XCTest API usage to Swift Testing and
maintain the error severity of your asserts. This effectively makes it
so that Swift Testing API functions "as expected" on ALL interop modes
except for none.
@jerryjrchen jerryjrchen self-assigned this Apr 16, 2026
@jerryjrchen jerryjrchen added evolution process A change to the meta-content of evolution, e.g. the process documentation or templates content change Content change to an existing document TWG Contains topics under the domain of the Testing Workgroup workgroup: needs pitch This proposal needs to spend more time in pitch before it can be reviewed and removed evolution process A change to the meta-content of evolution, e.g. the process documentation or templates labels Apr 16, 2026
@jerryjrchen jerryjrchen moved this from Backlog to In review in [Swift Testing] Interoperability Apr 16, 2026
@jerryjrchen
Copy link
Copy Markdown
Contributor Author

  • Small typo in the title but it won't let me edit the draft title it seems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content change Content change to an existing document TWG Contains topics under the domain of the Testing Workgroup workgroup: needs pitch This proposal needs to spend more time in pitch before it can be reviewed

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

1 participant