Skip to content

Commit d092fa9

Browse files
authored
Merge branch 'main' into ST-0013-deprecation-addendum
2 parents 44302dc + 16c6864 commit d092fa9

File tree

4 files changed

+34
-42
lines changed

4 files changed

+34
-42
lines changed

proposals/0460-specialized.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Proposal: [SE-0460](0460-specialized.md)
44
* Authors: [Ben Cohen](https://github.com/airspeedswift)
55
* Review Manager: [Steve Canon](https://github.com/stephentyrone)
6-
* Status: **Accepted**
7-
* Implementation: Available in nightly toolchains using the underscored `@_specialize`
6+
* Status: **Implemented (Swift Next)**
87
* Review: ([pitch](https://forums.swift.org/t/pitch-explicit-specialization/76967)) ([review](https://forums.swift.org/t/se-0460-explicit-specialization/77541)) ([acceptance](https://forums.swift.org/t/accepted-se-0460-explicit-specialization/78583))
98

109
## Introduction

proposals/0476-abi-attr.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Proposal: [SE-0476](0476-abi-attr.md)
44
* Authors: [Becca Royal-Gordon](https://github.com/beccadax)
55
* Review Manager: [Holly Borla](https://github.com/hborla)
6-
* Status: **Accepted**
7-
* Implementation: behind experimental feature `ABIAttribute` (refinements in [swiftlang/swift#80383](https://github.com/swiftlang/swift/pull/80383))
6+
* Status: **Implemented (Swift 6.2)**
87
* Review: ([pitch](https://forums.swift.org/t/pitch-controlling-the-abi-of-a-declaration/75123)) ([review](https://forums.swift.org/t/se-0476-controlling-the-abi-of-a-function-initializer-property-or-subscript/79233)) ([acceptance](https://forums.swift.org/t/accepted-with-modifications-se-0476-controlling-the-abi-of-a-function-initializer-property-or-subscript/79644))
98

109
## Introduction

proposals/0487-extensible-enums.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
* Proposal: [SE-0487](0487-extensible-enums.md)
44
* Authors: [Pavel Yaskevich](https://github.com/xedin), [Franz Busch](https://github.com/FranzBusch), [Cory Benfield](https://github.com/lukasa)
55
* Review Manager: [Ben Cohen](https://github.com/airspeedswift)
6-
* Status: **[Accepted](https://forums.swift.org/t/accepted-se-0487-nonexhaustive-enums/81508)**
6+
* Status: **Accepted**
77
* Bug: [apple/swift#55110](https://github.com/swiftlang/swift/issues/55110)
88
* Implementation: [apple/swift#80503](https://github.com/swiftlang/swift/pull/80503)
99
* Upcoming Feature Flag: `ExtensibleAttribute`
10-
* Review: ([pitch](https://forums.swift.org/t/pitch-extensible-enums-for-non-resilient-modules/77649))
10+
* Review: ([pitch](https://forums.swift.org/t/pitch-extensible-enums-for-non-resilient-modules/77649)) ([first review](https://forums.swift.org/t/se-0487-extensible-enums/80114)) ([second review](https://forums.swift.org/t/second-review-se-0487-extensible-enums/80837)) ([acceptance](https://forums.swift.org/t/accepted-se-0487-nonexhaustive-enums/81508))
1111

1212
Previously pitched in:
1313

proposals/testing/0013-issue-severity-warning.md

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
- Proposal: [ST-0013](0013-issue-severity-warning.md)
44
- Authors: [Suzy Ratcliff](https://github.com/suzannaratcliff)
55
- Review Manager: [Maarten Engels](https://github.com/maartene)
6-
- Status: **Accepted**
7-
- Implementation: [swiftlang/swift-testing#1075](https://github.com/swiftlang/swift-testing/pull/1075)
8-
- Review: ([pitch](https://forums.swift.org/t/pitch-test-issue-warnings/79285)) ([review](https://forums.swift.org/t/st-0013-test-issue-warnings/80991)) ([accepted](https://forums.swift.org/t/accepted-st-0013-test-issue-severity/81385))
6+
- Status: **Implemented (Swift 6.3)**
7+
- Implementation: [swiftlang/swift-testing#1075](https://github.com/swiftlang/swift-testing/pull/1075),
8+
[swiftlang/swift-testing#1247](https://github.com/swiftlang/swift-testing/pull/1247)
9+
- Review: ([pitch](https://forums.swift.org/t/pitch-test-issue-warnings/79285)) ([review](https://forums.swift.org/t/st-0013-test-issue-warnings/80991)) ([acceptance](https://forums.swift.org/t/accepted-st-0013-test-issue-severity/81385))
910

1011
## Introduction
1112

@@ -48,6 +49,7 @@ The `Severity` enum:
4849
```swift
4950
extension Issue {
5051
// ...
52+
5153
public enum Severity: Codable, Comparable, CustomStringConvertible, Sendable {
5254
/// The severity level for an issue which should be noted but is not
5355
/// necessarily an error.
@@ -62,7 +64,6 @@ extension Issue {
6264
/// marked as a failure.
6365
case error
6466
}
65-
// ...
6667
}
6768
```
6869

@@ -77,6 +78,9 @@ Issue.record("My comment", severity: .warning)
7778
Here is the `Issue.record` method definition with severity as a parameter.
7879

7980
```swift
81+
extension Issue {
82+
// ...
83+
8084
/// Record an issue when a running test and an issue occurs.
8185
///
8286
/// - Parameters:
@@ -95,8 +99,7 @@ Here is the `Issue.record` method definition with severity as a parameter.
9599
severity: Severity = .error,
96100
sourceLocation: SourceLocation = #_sourceLocation
97101
) -> Self
98-
99-
// ...
102+
}
100103
```
101104

102105
### Issue Type Enhancements
@@ -106,13 +109,11 @@ The Issue type is enhanced with two new properties to better handle and report i
106109
- `severity`: This property allows access to the specific severity level of an issue, enabling more precise handling of test results.
107110

108111
```swift
109-
// ...
110-
111112
extension Issue {
113+
// ...
112114

113-
/// The severity of the issue.
114-
public var severity: Severity { get set }
115-
115+
/// The severity of the issue.
116+
public var severity: Severity { get set }
116117
}
117118

118119
```
@@ -140,11 +141,10 @@ extension Issue {
140141
Example usage of `severity` and `isFailure`:
141142

142143
```swift
143-
// ...
144144
withKnownIssue {
145145
// ...
146146
} matching: { issue in
147-
return issue.isFailure || issue.severity > .warning
147+
issue.isFailure || issue.severity > .warning
148148
}
149149
```
150150

@@ -182,19 +182,21 @@ extension Issue {
182182
}
183183
```
184184

185-
### Integration with supporting tools
185+
## Integration with supporting tools
186+
187+
### Event stream
186188

187189
Issue severity will be in the event stream output when a `issueRecorded` event occurs. This will be a breaking change because some tools may assume that all `issueRecorded` events are failing. Due to this we will be bumping the event stream version and v1 will maintain it's behavior and not output any events for non failing issues. We will also be adding `isFailure` to the issue so that clients will know if the issue should be treated as a failure. `isFailure` is a computed property.
188190

189191
The JSON event stream ABI will be amended correspondingly:
190192

191-
```
192-
<issue> ::= {
193-
"isKnown": <bool>, ; is this a known issue or not?
194-
+ "severity": <string>, ; the severity of the issue
195-
+ "isFailure": <bool>, ; if the issue is a failing issue
196-
["sourceLocation": <source-location>,] ; where the issue occurred, if known
197-
}
193+
```diff
194+
<issue> ::= {
195+
"isKnown": <bool>, ; is this a known issue or not?
196+
+ "severity": <string>, ; the severity of the issue
197+
+ "isFailure": <bool>, ; if the issue is a failing issue
198+
["sourceLocation": <source-location>,] ; where the issue occurred, if known
199+
}
198200
```
199201

200202
Example of an `issueRecorded` event in the json output:
@@ -205,29 +207,21 @@ Example of an `issueRecorded` event in the json output:
205207

206208
### Console output
207209

208-
When there is an issue recorded with severity warning the output looks like this:
210+
When there is an issue recorded with severity warning, such as using the following code:
209211

210212
```swift
211-
Issue.record("My comment", severity: .warning)
212-
```
213-
214-
```
215-
􀟈 Test "All elements of two ranges are equal" started.
216-
􀄣 Test "All elements of two ranges are equal" recorded a warning at ZipTests.swift:32:17: Issue recorded
217-
􀄵 My comment
218-
􁁛 Test "All elements of two ranges are equal" passed after 0.001 seconds with 1 warning.
213+
Issue.record("My comment", severity: .warning)
219214
```
220215

221-
### Trying this out
222-
223-
To use severity today, checkout the branch here: https://github.com/swiftlang/swift-testing/pull/1189
216+
the console output will look like the following:
224217

225218
```
226-
.package(url: "https://github.com/suzannaratcliff/swift-testing.git", branch: "suzannaratcliff:suzannaratcliff/enable-severity"),
219+
◇ Test "All elements of two ranges are equal" started.
220+
� Test "All elements of two ranges are equal" recorded a warning at ZipTests.swift:32:17: Issue recorded
221+
↳ My comment
222+
✔ Test "All elements of two ranges are equal" passed after 0.001 seconds with 1 warning.
227223
```
228224

229-
For more details on how to checkout a branch for a package refer to this: https://developer.apple.com/documentation/packagedescription/package/dependency/package(url:branch:)
230-
231225
## Alternatives considered
232226

233227
- Separate Issue Creation and Recording: We considered providing a mechanism to create issues independently before recording them, rather than passing the issue details directly to the `record` method. This approach was ultimately set aside in favor of simplicity and directness in usage.

0 commit comments

Comments
 (0)