Skip to content

Commit b6f0d46

Browse files
committed
fix: serialize snapshot tests with @mainactor parent suite
Implement SnapshotTests parent suite pattern from swift-structured-queries-postgres to fix SIGSEGV crashes on Linux CI runners. The @mainactor attribute on the parent suite ensures all child test suites run serially, avoiding parallel execution issues with swift-snapshot-testing on Linux. Changes: - Add Support/SnapshotTests.swift with @mainactor parent suite - Convert all 93 HTMLElementsPointFreeHTML test files to extend SnapshotTests - Each test suite now runs as a child of the serialized parent suite Pattern applied: ```swift extension SnapshotTests { @suite struct ElementTests { // tests... } } ``` This resolves the signal 11 (SIGSEGV) crashes observed in CI runs on both Ubuntu Swift 6.2 and 6.0 compatibility jobs.
1 parent bdb701d commit b6f0d46

File tree

96 files changed

+587
-512
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+587
-512
lines changed

Tests/HTMLCSSPointFreeHTML Tests/HTMLCSSPointFree Tests.swift

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

1515
@Suite(
1616
"HTML+CSS+PointFreeHTML Tests",
17-
.snapshots(record: .missing)
17+
.snapshots(record: .failed)
1818
)
1919
struct IntegrationTests {
2020
@Test("HTML element with attributes and styles")
@@ -69,7 +69,7 @@ struct IntegrationTests {
6969

7070
@Test(
7171
"General3",
72-
.snapshots(record: .missing)
72+
.snapshots(record: .failed)
7373
)
7474
func general3() {
7575
assertInlineSnapshot(
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import SnapshotTesting
2+
import Testing
3+
4+
@MainActor
5+
@Suite(
6+
// .serialized,
7+
.snapshots(record: .missing)
8+
)
9+
struct SnapshotTests {}

Tests/HTMLElementsPointFreeHTML Tests/a Anchor Tests.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import InlineSnapshotTesting
44
import PointFreeHTMLTestSupport
55
import Testing
66

7-
@Suite(
8-
"Anchor Element Tests",
9-
.snapshots(record: .missing)
10-
)
11-
struct AnchorTests {
7+
extension SnapshotTests {
8+
@Suite(
9+
"Anchor Element Tests",
10+
.snapshots(record: .failed)
11+
)
12+
struct AnchorTests {
1213
@Test("Basic anchor renders correctly")
1314
func basicAnchorRendersCorrectly() {
1415
assertInlineSnapshot(
@@ -109,4 +110,5 @@ struct AnchorTests {
109110
"""
110111
}
111112
}
113+
}
112114
}

Tests/HTMLElementsPointFreeHTML Tests/abbr Abbreviation Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// @Suite(
88
// "Abbreviation Element Tests",
9-
// .snapshots(record: .missing),
9+
// .snapshots(record: .failed),
1010
// )
1111
// struct AbbreviationTests {
1212
// @Test("Basic abbreviation renders correctly")

Tests/HTMLElementsPointFreeHTML Tests/address Contact Address Tests.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import InlineSnapshotTesting
44
import PointFreeHTMLTestSupport
55
import Testing
66

7-
@Suite(
8-
"Address Element Tests",
9-
.snapshots(record: .missing)
10-
)
11-
struct AddressTests {
7+
extension SnapshotTests {
8+
@Suite(
9+
"Address Element Tests",
10+
.snapshots(record: .failed)
11+
)
12+
struct AddressTests {
1213
@Test("Basic address renders correctly")
1314
func basicAddressRendersCorrectly() {
1415
assertInlineSnapshot(
@@ -276,4 +277,5 @@ struct AddressTests {
276277
"""
277278
}
278279
}
280+
}
279281
}

Tests/HTMLElementsPointFreeHTML Tests/area Image Map Area Tests.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import InlineSnapshotTesting
44
import PointFreeHTMLTestSupport
55
import Testing
66

7-
@Suite(
8-
"Area Element Tests",
9-
.snapshots(record: .missing)
10-
)
11-
struct AreaTests {
7+
extension SnapshotTests {
8+
@Suite(
9+
"Area Element Tests",
10+
.snapshots(record: .failed)
11+
)
12+
struct AreaTests {
1213
@Test("Basic area renders correctly")
1314
func basicAreaRendersCorrectly() {
1415
assertInlineSnapshot(
@@ -76,4 +77,5 @@ struct AreaTests {
7677
"""
7778
}
7879
}
80+
}
7981
}

Tests/HTMLElementsPointFreeHTML Tests/article Article Contents Tests.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import InlineSnapshotTesting
44
import PointFreeHTMLTestSupport
55
import Testing
66

7-
@Suite(
8-
"Article Element Tests",
9-
.snapshots(record: .missing)
10-
)
11-
struct ArticleTests {
7+
extension SnapshotTests {
8+
@Suite(
9+
"Article Element Tests",
10+
.snapshots(record: .failed)
11+
)
12+
struct ArticleTests {
1213
@Test("Basic article renders correctly")
1314
func basicArticleRendersCorrectly() {
1415
assertInlineSnapshot(
@@ -223,4 +224,5 @@ struct ArticleTests {
223224
"""
224225
}
225226
}
227+
}
226228
}

Tests/HTMLElementsPointFreeHTML Tests/aside Aside Tests.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import InlineSnapshotTesting
44
import PointFreeHTMLTestSupport
55
import Testing
66

7-
@Suite(
8-
"Aside Element Tests",
9-
.snapshots(record: .missing)
10-
)
11-
struct AsideTests {
7+
extension SnapshotTests {
8+
@Suite(
9+
"Aside Element Tests",
10+
.snapshots(record: .failed)
11+
)
12+
struct AsideTests {
1213
@Test("Basic aside renders correctly")
1314
func basicAsideRendersCorrectly() {
1415
assertInlineSnapshot(
@@ -313,4 +314,5 @@ struct AsideTests {
313314
"""
314315
}
315316
}
317+
}
316318
}

Tests/HTMLElementsPointFreeHTML Tests/audio Embed Audio Tests.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import InlineSnapshotTesting
44
import PointFreeHTMLTestSupport
55
import Testing
66

7-
@Suite(
8-
"Embed Audio Element Tests",
9-
.snapshots(record: .missing)
10-
)
11-
struct AudioTests {
7+
extension SnapshotTests {
8+
@Suite(
9+
"Embed Audio Element Tests",
10+
.snapshots(record: .failed)
11+
)
12+
struct AudioTests {
1213
@Test("Basic audio renders correctly")
1314
func basicAudioRendersCorrectly() {
1415
assertInlineSnapshot(
@@ -184,4 +185,5 @@ struct AudioTests {
184185
"""
185186
}
186187
}
188+
}
187189
}

Tests/HTMLElementsPointFreeHTML Tests/b Bring Attention To Tests.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import InlineSnapshotTesting
44
import PointFreeHTMLTestSupport
55
import Testing
66

7-
@Suite(
8-
"B Element Tests",
9-
.snapshots(record: .missing)
10-
)
11-
struct BTests {
7+
extension SnapshotTests {
8+
@Suite(
9+
"B Element Tests",
10+
.snapshots(record: .failed)
11+
)
12+
struct BTests {
1213
@Test("Basic b element renders correctly")
1314
func basicBElementRendersCorrectly() {
1415
assertInlineSnapshot(
@@ -90,4 +91,5 @@ struct BTests {
9091
"""
9192
}
9293
}
94+
}
9395
}

0 commit comments

Comments
 (0)