Skip to content

Commit 2bfffa9

Browse files
Rename .serial to .serialized. (#385)
Pending an API review thread on the forums, we've decided to rename this trait to `.serialized`. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated. --------- Co-authored-by: Stuart Montgomery <[email protected]>
1 parent dcce2c7 commit 2bfffa9

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

Sources/Testing/Running/Runner.Plan.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ extension Runner {
2222
/// ``Configuration/isParallelizationEnabled`` property of the
2323
/// configuration passed during initialization has a value of `true`.
2424
///
25-
/// Traits such as ``Trait/serial`` applied to individual tests may
25+
/// Traits such as ``Trait/serialized`` applied to individual tests may
2626
/// affect whether or not that test is parallelized.
2727
///
2828
/// ## See Also
2929
///
30-
/// - ``SerialTrait``
30+
/// - ``ParallelizationTrait``
3131
public var isParallelizationEnabled: Bool
3232
}
3333

Sources/Testing/Testing.docc/Parallelization.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ run in the same process. The number of tests that run concurrently is controlled
2020
by the Swift runtime.
2121

2222
<!--
23-
HIDDEN: .serial is experimental SPI pending feature review.
23+
HIDDEN: .serialized is experimental SPI pending feature review.
2424
2525
## Disabling parallelization
2626
2727
Parallelization can be disabled on a per-function or per-suite basis using the
28-
``Trait/serial`` trait:
28+
``Trait/serialized`` trait:
2929
3030
```swift
31-
@Test(.serial, arguments: Food.allCases) func prepare(food: Food) {
31+
@Test(.serialized, arguments: Food.allCases) func prepare(food: Food) {
3232
// This function will be invoked serially, once per food, because it has the
33-
// .serial trait.
33+
// .serialized trait.
3434
}
3535
36-
@Suite(.serial) struct FoodTruckTests {
36+
@Suite(.serialized) struct FoodTruckTests {
3737
@Test(arguments: Condiment.allCases) func refill(condiment: Condiment) {
3838
// This function will be invoked serially, once per condiment, because the
39-
// containing suite has the .serial trait.
39+
// containing suite has the .serialized trait.
4040
}
4141
4242
@Test func startEngine() async throws {
@@ -62,6 +62,6 @@ disabled (by, for example, passing `--no-parallel` to the `swift test` command.)
6262
6363
## Topics
6464
65-
- ``Trait/serial``
66-
- ``SerialTrait``
65+
- ``Trait/serialized``
66+
- ``ParallelizationTrait``
6767
-->

Sources/Testing/Testing.docc/Traits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ behavior of test functions.
3434
- ``Trait/timeLimit(_:)``
3535

3636
<!--
37-
HIDDEN: .serial is experimental SPI pending feature review.
37+
HIDDEN: .serialized is experimental SPI pending feature review.
3838
### Running tests serially or in parallel
39-
- ``SerialTrait``
39+
- ``ParallelizationTrait``
4040
-->
4141

4242
### Annotating tests

Sources/Testing/Traits/SerialTrait.swift renamed to Sources/Testing/Traits/ParallelizationTrait.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
/// globally disabled (by, for example, passing `--no-parallel` to the
2626
/// `swift test` command.)
2727
///
28-
/// To add this trait to a test, use ``Trait/serial``.
28+
/// To add this trait to a test, use ``Trait/serialized``.
2929
@_spi(Experimental)
30-
public struct SerialTrait: TestTrait, SuiteTrait {
30+
public struct ParallelizationTrait: TestTrait, SuiteTrait {
3131
public var isRecursive: Bool {
3232
true
3333
}
@@ -36,7 +36,7 @@ public struct SerialTrait: TestTrait, SuiteTrait {
3636
// MARK: - SPIAwareTrait
3737

3838
@_spi(ForToolsIntegrationOnly)
39-
extension SerialTrait: SPIAwareTrait {
39+
extension ParallelizationTrait: SPIAwareTrait {
4040
public func prepare(for test: Test, action: inout Runner.Plan.Action) async throws {
4141
if case var .run(options) = action {
4242
options.isParallelizationEnabled = false
@@ -48,13 +48,13 @@ extension SerialTrait: SPIAwareTrait {
4848
// MARK: -
4949

5050
@_spi(Experimental)
51-
extension Trait where Self == SerialTrait {
51+
extension Trait where Self == ParallelizationTrait {
5252
/// A trait that serializes the test to which it is applied.
5353
///
5454
/// ## See Also
5555
///
56-
/// - ``SerialTrait``
57-
public static var serial: Self {
56+
/// - ``ParallelizationTrait``
57+
public static var serialized: Self {
5858
Self()
5959
}
6060
}

Tests/TestingTests/Support/EnvironmentTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@testable @_spi(Experimental) import Testing
1212
private import TestingInternals
1313

14-
@Suite("Environment Tests", .serial)
14+
@Suite("Environment Tests", .serialized)
1515
struct EnvironmentTests {
1616
var name = "SWT_ENVIRONMENT_VARIABLE_FOR_TESTING"
1717

Tests/TestingTests/Traits/SerialTraitTests.swift renamed to Tests/TestingTests/Traits/ParallelizationTraitTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
@testable @_spi(Experimental) @_spi(ForToolsIntegrationOnly) import Testing
1212

13-
@Suite("Serial Trait Tests", .tags("trait"))
14-
struct SerialTraitTests {
15-
@Test(".serial trait is recursively applied")
16-
func serialTrait() async {
13+
@Suite("Parallelization Trait Tests", .tags("trait"))
14+
struct ParallelizationTraitTests {
15+
@Test(".serialized trait is recursively applied")
16+
func serializedTrait() async {
1717
var configuration = Configuration()
1818
configuration.isParallelizationEnabled = true
1919
let plan = await Runner.Plan(selecting: OuterSuite.self, configuration: configuration)
@@ -22,7 +22,7 @@ struct SerialTraitTests {
2222
}
2323
}
2424

25-
@Test(".serial trait serializes parameterized test")
25+
@Test(".serialized trait serializes parameterized test")
2626
func serializesParameterizedTestFunction() async {
2727
var configuration = Configuration()
2828
configuration.isParallelizationEnabled = true
@@ -56,7 +56,7 @@ struct SerialTraitTests {
5656

5757
// MARK: - Fixtures
5858

59-
@Suite(.hidden, .serial)
59+
@Suite(.hidden, .serialized)
6060
private struct OuterSuite {
6161
/* This @Suite intentionally left blank */ struct IntermediateSuite {
6262
@Suite(.hidden)

0 commit comments

Comments
 (0)