Skip to content

Commit 2bda17d

Browse files
vkuttypCopilot
andcommitted
fix: add @unchecked Sendable to all test classes for Swift 6 compatibility
Swift 6 strict concurrency requires XCTestCase subclasses that capture self in @sendable closures to conform to Sendable. Mark all test classes as @unchecked Sendable (safe for test-only code). Also fix testSelectFloat() type-checker timeout by rewriting chained ?? as explicit if-let branches, and simplify CI matrix to Swift 6.0 only (Swift 5.9 toolchain not available for ubuntu-24.04 runners). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 762496a commit 2bda17d

16 files changed

Lines changed: 78 additions & 81 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
os: [macos-15, ubuntu-24.04]
39-
swift: ["5.9", "6.0"]
40-
exclude:
41-
# macOS 15 ships with Swift 6 (Xcode 16); skip redundant 5.10 run
42-
- os: macos-15
43-
swift: "5.10"
39+
swift: ["6.0"]
4440
steps:
4541
- name: Checkout
4642
uses: actions/checkout@v4

Tests/MSSQLNioTests/MSSQLAdvancedFeatureTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SQLNioCore
44

55
// ── Tests for TEXT/NTEXT/IMAGE, SQLDataTable, bulkInsert, checkReachability ──
66

7-
final class MSSQLAdvancedFeatureTests: XCTestCase {
7+
final class MSSQLAdvancedFeatureTests: XCTestCase, @unchecked Sendable {
88

99
override func setUp() async throws {
1010
try skipUnlessIntegration()

Tests/MSSQLNioTests/MSSQLDataTypeTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import SQLNioCore
2323
// NVARCHAR (0xE7) → .string VARCHAR (0xA7) → .string
2424
// UUID (0x24) → .uuid
2525

26-
final class MSSQLDataTypeTests: XCTestCase {
26+
final class MSSQLDataTypeTests: XCTestCase, @unchecked Sendable {
2727

2828
// ── Helpers ──────────────────────────────────────────────────────────────
2929

Tests/MSSQLNioTests/MSSQLErrorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SQLNioCore
44

55
// ── Error handling integration tests ─────────────────────────────────────────
66

7-
final class MSSQLErrorTests: XCTestCase {
7+
final class MSSQLErrorTests: XCTestCase, @unchecked Sendable {
88

99
override func setUp() async throws {
1010
try skipUnlessIntegration()

Tests/MSSQLNioTests/MSSQLNewFeatureTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import SQLNioCore
99
// • Decimal precision (MONEY / DECIMAL / NUMERIC)
1010
// • INFO/PRINT message surfacing
1111

12-
final class MSSQLNewFeatureTests: XCTestCase {
12+
final class MSSQLNewFeatureTests: XCTestCase, @unchecked Sendable {
1313

1414
// ── Decimal / MONEY precision ─────────────────────────────────────────────
1515

Tests/MSSQLNioTests/MSSQLNioTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import NIOCore
33
import NIOEmbedded
44
@testable import MSSQLNio
55

6-
final class TDSPacketTests: XCTestCase {
6+
final class TDSPacketTests: XCTestCase, @unchecked Sendable {
77

88
func testHeaderRoundtrip() throws {
99
var allocator = ByteBufferAllocator()
@@ -45,7 +45,7 @@ final class TDSPacketTests: XCTestCase {
4545
}
4646
}
4747

48-
final class TDSDecoderTests: XCTestCase {
48+
final class TDSDecoderTests: XCTestCase, @unchecked Sendable {
4949

5050
func testDecodeColMetadata() throws {
5151
// Build a minimal COLMETADATA token

Tests/MSSQLNioTests/MSSQLQueryTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SQLNioCore
44

55
// ── Query scenario integration tests ─────────────────────────────────────────
66

7-
final class MSSQLQueryTests: XCTestCase {
7+
final class MSSQLQueryTests: XCTestCase, @unchecked Sendable {
88

99
override func setUp() async throws {
1010
try skipUnlessIntegration()
@@ -337,7 +337,7 @@ final class MSSQLQueryTests: XCTestCase {
337337

338338
// MARK: - Backup & Restore Tests
339339

340-
final class MSSQLBackupTests: XCTestCase {
340+
final class MSSQLBackupTests: XCTestCase, @unchecked Sendable {
341341

342342
override func setUp() async throws { try skipUnlessIntegration() }
343343

Tests/MSSQLNioTests/MSSQLStoredProcTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SQLNioCore
44

55
// ── Stored procedure integration tests ───────────────────────────────────────
66

7-
final class MSSQLStoredProcTests: XCTestCase {
7+
final class MSSQLStoredProcTests: XCTestCase, @unchecked Sendable {
88

99
override func setUp() async throws {
1010
try skipUnlessIntegration()

Tests/MSSQLNioTests/NTLMTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import XCTest
1515
// MSSQL_NTLM_HOST=winserver MSSQL_NTLM_USER=testuser MSSQL_NTLM_PASS=secret
1616
// MSSQL_NTLM_DOMAIN=CONTOSO swift test --filter NTLMTests.testNTLMConnection
1717

18-
final class NTLMTests: XCTestCase {
18+
final class NTLMTests: XCTestCase, @unchecked Sendable {
1919

2020
// MARK: - MD4 tests (RFC 1320 §A.5 test vectors)
2121

Tests/MSSQLNioTests/SQLClientCompatTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import SQLNioCore
1414

1515
// MARK: - Basic Query Tests
1616

17-
final class SQLClientCompatBasicTests: XCTestCase {
17+
final class SQLClientCompatBasicTests: XCTestCase, @unchecked Sendable {
1818

1919
override func setUp() async throws { try skipUnlessIntegration() }
2020

@@ -237,7 +237,7 @@ final class SQLClientCompatBasicTests: XCTestCase {
237237

238238
// MARK: - Transaction Tests
239239

240-
final class SQLClientCompatTransactionTests: XCTestCase {
240+
final class SQLClientCompatTransactionTests: XCTestCase, @unchecked Sendable {
241241

242242
override func setUp() async throws { try skipUnlessIntegration() }
243243

@@ -298,7 +298,7 @@ final class SQLClientCompatTransactionTests: XCTestCase {
298298

299299
// MARK: - Stored Procedure / RPC Tests
300300

301-
final class SQLClientCompatProcTests: XCTestCase {
301+
final class SQLClientCompatProcTests: XCTestCase, @unchecked Sendable {
302302

303303
override func setUp() async throws { try skipUnlessIntegration() }
304304

@@ -447,7 +447,7 @@ final class SQLClientCompatProcTests: XCTestCase {
447447

448448
// MARK: - Bulk Insert Tests
449449

450-
final class SQLClientCompatBulkTests: XCTestCase {
450+
final class SQLClientCompatBulkTests: XCTestCase, @unchecked Sendable {
451451

452452
override func setUp() async throws { try skipUnlessIntegration() }
453453

@@ -503,7 +503,7 @@ final class SQLClientCompatBulkTests: XCTestCase {
503503

504504
// MARK: - Connection Pool Tests
505505

506-
final class SQLClientCompatPoolTests: XCTestCase {
506+
final class SQLClientCompatPoolTests: XCTestCase, @unchecked Sendable {
507507

508508
override func setUp() async throws { try skipUnlessIntegration() }
509509

0 commit comments

Comments
 (0)