Skip to content

Commit 33c16da

Browse files
authored
Remove @_spi annotations from ParallelizationTrait and .serialized (#580)
Following up on #535, apply the changes described in SWT-0003, along with a few documentation tweaks to reflect the API status. ### Result: The `.serialized` test trait can be used as stable API without any `@_spi` import modifiers.
1 parent 2206894 commit 33c16da

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

Diff for: Sources/Testing/Testing.docc/Parallelization.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ accomplished by the testing library using task groups, and tests generally all
1919
run in the same process. The number of tests that run concurrently is controlled
2020
by the Swift runtime.
2121

22-
<!--
23-
HIDDEN: .serialized is experimental SPI pending feature review.
24-
2522
## Disabling parallelization
2623

2724
Parallelization can be disabled on a per-function or per-suite basis using the
@@ -56,12 +53,6 @@ This trait is recursively applied: if it is applied to a suite, any
5653
parameterized tests or test suites contained in that suite are also serialized
5754
(as are any tests contained in those suites, and so on.)
5855

59-
This trait does not affect the execution of a test relative to its peers or to
56+
This trait doesn't affect the execution of a test relative to its peers or to
6057
unrelated tests. This trait has no effect if test parallelization is globally
6158
disabled (by, for example, passing `--no-parallel` to the `swift test` command.)
62-
63-
## Topics
64-
65-
- ``Trait/serialized``
66-
- ``ParallelizationTrait``
67-
-->

Diff for: Sources/Testing/Testing.docc/Traits.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,17 @@ behavior of test functions.
2525

2626
- <doc:EnablingAndDisabling>
2727
- <doc:LimitingExecutionTime>
28-
- <doc:Parallelization>
2928
- ``Trait/enabled(if:_:sourceLocation:)``
3029
- ``Trait/enabled(_:sourceLocation:_:)``
3130
- ``Trait/disabled(_:sourceLocation:)``
3231
- ``Trait/disabled(if:_:sourceLocation:)``
3332
- ``Trait/disabled(_:sourceLocation:_:)``
3433
- ``Trait/timeLimit(_:)``
3534

36-
<!--
37-
HIDDEN: .serialized is experimental SPI pending feature review.
3835
### Running tests serially or in parallel
39-
- ``ParallelizationTrait``
40-
-->
36+
37+
- <doc:Parallelization>
38+
- ``Trait/serialized``
4139

4240
### Annotating tests
4341

@@ -61,6 +59,7 @@ HIDDEN: .serialized is experimental SPI pending feature review.
6159
- ``Bug``
6260
- ``Comment``
6361
- ``ConditionTrait``
62+
- ``ParallelizationTrait``
6463
- ``Tag``
6564
- ``Tag/List``
6665
- ``TimeLimitTrait``

Diff for: Sources/Testing/Testing.docc/Traits/Trait.md

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ See https://swift.org/CONTRIBUTORS.txt for Swift project authors
2424

2525
- ``Trait/timeLimit(_:)``
2626

27+
### Running tests serially or in parallel
28+
29+
- ``Trait/serialized``
30+
2731
### Categorizing tests
2832

2933
- ``Trait/tags(_:)``

Diff for: Sources/Testing/Traits/ParallelizationTrait.swift

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
/// `swift test` command.)
2727
///
2828
/// To add this trait to a test, use ``Trait/serialized``.
29-
@_spi(Experimental)
3029
public struct ParallelizationTrait: TestTrait, SuiteTrait {
3130
public var isRecursive: Bool {
3231
true
@@ -47,7 +46,6 @@ extension ParallelizationTrait: SPIAwareTrait {
4746

4847
// MARK: -
4948

50-
@_spi(Experimental)
5149
extension Trait where Self == ParallelizationTrait {
5250
/// A trait that serializes the test to which it is applied.
5351
///

0 commit comments

Comments
 (0)