Skip to content

Commit 083767b

Browse files
committed
Merge branch 'main' into jgrynspan/third-party-testing-library-discovery
2 parents 806578b + 6057594 commit 083767b

14 files changed

Lines changed: 100 additions & 19 deletions

File tree

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/automerge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
jobs:
1919
create_merge_pr:
2020
name: Create PR to merge main into release branch
21-
uses: swiftlang/github-workflows/.github/workflows/create_automerge_pr.yml@main
21+
uses: swiftlang/github-workflows/.github/workflows/create_automerge_pr.yml@0.0.3
2222
with:
2323
head_branch: main
2424
base_branch: release/6.3

.github/workflows/main_using_main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
jobs:
1616
tests:
1717
name: Test
18-
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
18+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.2
1919
with:
2020
linux_swift_versions: '["nightly-main"]'
2121
linux_os_versions: '["amazonlinux2", "jammy"]'

.github/workflows/main_using_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
jobs:
1616
tests:
1717
name: Test
18-
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
18+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.2
1919
with:
2020
linux_swift_versions: '["nightly-6.2"]'
2121
linux_os_versions: '["amazonlinux2", "jammy"]'

.github/workflows/pull_request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ concurrency:
1414
jobs:
1515
tests:
1616
name: Test
17-
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
17+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.2
1818
with:
19-
linux_swift_versions: '["nightly-main", "nightly-6.2"]'
19+
linux_swift_versions: '["nightly-main", "nightly-6.3", "nightly-6.2"]'
2020
linux_os_versions: '["amazonlinux2", "jammy"]'
21-
windows_swift_versions: '["nightly-main", "nightly-6.2"]'
21+
windows_swift_versions: '["nightly-main", "nightly-6.3", "nightly-6.2"]'
2222
enable_macos_checks: true
2323
macos_exclude_xcode_versions: '[{"xcode_version": "16.2"}, {"xcode_version": "16.3"}, {"xcode_version": "16.4"}]'
2424
enable_ios_checks: true
@@ -27,7 +27,7 @@ jobs:
2727
enable_android_sdk_build: true
2828
soundness:
2929
name: Soundness
30-
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
30+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@0.0.3
3131
with:
3232
license_header_check_project_name: "Swift"
3333
docs_check_enabled: false

Sources/Overlays/_Testing_Foundation/Attachments/Attachment+URL.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extension Attachment where AttachableValue == _AttachableURLWrapper {
4747
///
4848
/// When you call this initializer and pass it the URL of a file, it reads or
4949
/// maps the contents of that file into memory. When you call this initializer
50-
/// and pass it the URL of a directory, it creates a temporary zip file of the
50+
/// and pass it the URL of a directory, it creates a temporary ZIP file of the
5151
/// directory before reading or mapping it into memory. These operations may
5252
/// take some time, so this initializer suspends the calling task until they
5353
/// are complete.

Sources/Testing/ABI/ABI.Record.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,26 @@ extension ABI.Record: Codable {
8585
init(from decoder: any Decoder) throws {
8686
let container = try decoder.container(keyedBy: CodingKeys.self)
8787

88-
let versionNumber = try container.decode(VersionNumber.self, forKey: .version)
89-
if versionNumber != V.versionNumber {
88+
func validateVersionNumber(_ versionNumber: VersionNumber) throws {
89+
if versionNumber == V.versionNumber {
90+
return
91+
}
92+
#if !hasFeature(Embedded)
93+
// Allow for alternate version numbers if they correspond to the expected
94+
// record version (e.g. "1.2.3" might map to `v1_2_0` without a problem.)
95+
if ABI.version(forVersionNumber: versionNumber) == V.self {
96+
return
97+
}
98+
#endif
9099
throw DecodingError.dataCorrupted(
91100
DecodingError.Context(
92101
codingPath: decoder.codingPath + CollectionOfOne(CodingKeys.version as any CodingKey),
93102
debugDescription: "Unexpected record version \(versionNumber) (expected \(V.versionNumber))."
94103
)
95104
)
96105
}
106+
let versionNumber = try container.decode(VersionNumber.self, forKey: .version)
107+
try validateVersionNumber(versionNumber)
97108

98109
switch try container.decode(String.self, forKey: .kind) {
99110
case "_library":

Sources/Testing/ABI/ABI.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extension ABI {
4343
}
4444

4545
/// The current supported ABI version (ignoring any experimental versions.)
46-
typealias CurrentVersion = v0
46+
typealias CurrentVersion = v6_3
4747

4848
/// The highest defined and supported ABI version (including any experimental
4949
/// versions.)
@@ -55,10 +55,18 @@ extension ABI {
5555
/// - Parameters:
5656
/// - versionNumber: The ABI version number for which a concrete type is
5757
/// needed.
58+
/// - swiftCompilerVersion: The version number of the Swift compiler. This
59+
/// is used when `versionNumber` is greater than the highest known version
60+
/// to determine whether a version type can be returned. The default value
61+
/// is the version of the Swift compiler which was used to build the
62+
/// testing library.
5863
///
5964
/// - Returns: A type conforming to ``ABI/Version`` that represents the given
6065
/// ABI version, or `nil` if no such type exists.
61-
static func version(forVersionNumber versionNumber: VersionNumber = ABI.CurrentVersion.versionNumber) -> (any Version.Type)? {
66+
static func version(
67+
forVersionNumber versionNumber: VersionNumber,
68+
givenSwiftCompilerVersion swiftCompilerVersion: @autoclosure () -> VersionNumber = swiftCompilerVersion
69+
) -> (any Version.Type)? {
6270
// Special-case the experimental ABI version number (which is intentionally
6371
// higher than any Swift release's version number).
6472
if versionNumber == ExperimentalVersion.versionNumber {
@@ -77,7 +85,7 @@ extension ABI {
7785
// Note also that building an old version of Swift Testing with a newer
7886
// compiler may produce incorrect results here. We don't generally support
7987
// that configuration though.
80-
if versionNumber > swiftCompilerVersion {
88+
if versionNumber > swiftCompilerVersion() {
8189
return nil
8290
}
8391
}

Sources/Testing/Issues/KnownIssue.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ struct KnownIssueScope: Sendable {
7777
/// - sourceLocation: The source location to which the issue should be
7878
/// attributed.
7979
private func _matchError(_ error: any Error, in scope: KnownIssueScope, comment: Comment?, sourceLocation: SourceLocation) throws {
80+
// ExpectationFailedError is thrown by expectation checking functions to
81+
// indicate a condition evaluated to `false`. Those functions record their
82+
// own issue, so we don't need to create a new issue and attempt to match it.
83+
if error is ExpectationFailedError {
84+
return
85+
}
86+
8087
let sourceContext = SourceContext(backtrace: Backtrace(forFirstThrowOf: error), sourceLocation: sourceLocation)
8188
var issue = Issue(kind: .errorCaught(error), comments: [], sourceContext: sourceContext)
8289
if let context = scope.matcher(issue) {

Sources/Testing/Running/Runner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extension Runner {
7777
/// type at runtime, it may be better-suited for ``Configuration`` instead.
7878
private struct _Context: Sendable {
7979
/// A serializer used to reduce parallelism among test cases.
80-
var testCaseSerializer: Serializer?
80+
var testCaseSerializer: Serializer<Void>?
8181
}
8282

8383
/// Apply the custom scope for any test scope providers of the traits

0 commit comments

Comments
 (0)