Skip to content

Commit 1e721f8

Browse files
committed
Update naming of default interop mode -> permissive
1 parent dc24e27 commit 1e721f8

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

proposals/testing/NNNN-swift-testing-and-xctest-interoperability.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ supported")`.
109109

110110
Here are some concrete examples:
111111

112-
| When running a Swift Testing test... | Current | Proposed (default) | Proposed (strict) |
112+
| When running a Swift Testing test... | Current | Proposed | Proposed (strict) |
113113
| ------------------------------------ | --------------- | -------------------------------------------- | ----------------- |
114114
| `XCTAssert` failure is a ... | ‼️ No-op | ❌ Test Failure and ⚠️ Runtime Warning Issue | 💥 `fatalError` |
115115
| `XCTAssert` success is a ... | No-op | ⚠️ Runtime Warning Issue | 💥 `fatalError` |
@@ -145,41 +145,38 @@ XCTest API _already_ provides similar functionality.
145145

146146
Here are some concrete examples:
147147

148-
| When running a XCTest test... | Current | Proposed (default) | Proposed (strict) |
148+
| When running a XCTest test... | Current | Proposed | Proposed (strict) |
149149
| -------------------------------------------- | --------------- | ------------------------ | ----------------- |
150150
| `#expect` failure is a ... | ‼️ No-op | ❌ Test Failure | ❌ Test Failure |
151151
| `#expect` success is a ... | No-op | No-op | No-op |
152152
| `withKnownIssue` wrapping `XCTFail` is a ... | ❌ Test Failure | ⚠️ Runtime Warning Issue | 💥 `fatalError` |
153153

154154
### Interoperability Modes
155155

156-
The default interoperability mode surfaces test failures that were previously
157-
ignored. We also include two alternative interoperability modes:
158-
159156
- **Warning-only**: This is for projects which do not want to see new test
160157
failures surfaced due to interoperability.
161158

162-
- **Strict**: Warning issues included in the default mode can be easily
159+
- **Permissive**: This is the default interoperability mode, which surfaces test
160+
failures that were previously ignored. It also includes runtime warning issues
161+
for XCTest API usage in a Swift Testing context.
162+
163+
- **Strict**: Warning issues included in the permissive mode can be easily
163164
overlooked, especially in CI. The strict mode guarantees that no XCTest API
164165
usage occurs when running Swift Testing tests by turning those warnings into a
165166
`fatalError`.
166167

167168
Configure the interoperability mode when running tests using the
168169
`SWIFT_TESTING_XCTEST_INTEROP_MODE` environment variable:
169170

170-
| Interop Mode | Issue behaviour across framework boundary | `SWIFT_TESTING_XCTEST_INTEROP_MODE` |
171-
| ------------ | ----------------------------------------------------------------- | ------------------------------------------- |
172-
| Warning-only | ⚠️ Runtime Warning Issue for XCTest API usage | `warning` |
173-
| Default | ❌ Test Failure and ⚠️ Runtime Warning Issue for XCTest API usage | `default`, or empty value, or invalid value |
174-
| Strict | 💥 `fatalError` for XCTest API usage | `strict` |
175-
176-
<!-- TODO: alternative name besides strict. It should reflect that, it does
177-
still have interop for SWT API in XCTest, but a hard failure going the other way
178-
around-->
171+
| Interop Mode | Issue behaviour across framework boundary | `SWIFT_TESTING_XCTEST_INTEROP_MODE` |
172+
| ------------ | ----------------------------------------------------------------- | ---------------------------------------------- |
173+
| Warning-only | XCTest API: ⚠️ Runtime Warning Issue | `warning-only` |
174+
| Permissive | XCTest API: ⚠️ Runtime Warning Issue. All Issues: ❌ Test Failure | `permissive`, or empty value, or invalid value |
175+
| Strict | XCTest API: 💥 `fatalError`. Swift Testing API: ❌ Test Failure | `strict` |
179176

180177
### Phased Rollout
181178

182-
When interoperability is first available, "default" will be the interop mode
179+
When interoperability is first available, "permissive" will be the default interop mode
183180
enabled for new projects. In a future release, "strict" will become the default
184181
interop mode.
185182

@@ -197,7 +194,7 @@ of options.
197194
## Integration with supporting tools
198195

199196
Interoperability will be first available in future toolchain version,
200-
hypothetically named `6.X`, where default interop mode will be enabled for
197+
hypothetically named `6.X`, where permissive interop mode will be enabled for
201198
projects. After that, a `7.Y` release would make strict interop mode the
202199
default.
203200

@@ -276,7 +273,7 @@ good balance between notifying users yet not breaking existing test suites.
276273
- **CLI option through SwiftPM:**
277274

278275
```
279-
swift test --interop-mode=warning-only
276+
swift test --interop-mode=warning
280277
```
281278

282279
This could be offered in addition to the proposed environment variable option,

0 commit comments

Comments
 (0)