Skip to content

Commit 8ed959b

Browse files
authored
Remove 'Runner.Plan.independentlyRunnableSteps' (#522)
This removes the `Runner.Plan.independentlyRunnableSteps` SPI and related code. This was initially needed for tools integration to support multi-process parallelization, but the approach has changed and this is no longer needed or used. ### 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.
1 parent 49d100b commit 8ed959b

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

Sources/Testing/Running/Runner.Plan.swift

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -303,52 +303,6 @@ extension Runner.Plan {
303303
}
304304
}
305305

306-
// MARK: - Parallelization support
307-
308-
extension Runner.Plan {
309-
/// Get the steps in a test graph that can run independently of each other.
310-
///
311-
/// - Parameters:
312-
/// - stepGraph: The step graph to recursively examine.
313-
///
314-
/// - Returns: The steps in `stepGraph` that can run independently of each
315-
/// other.
316-
///
317-
/// For more information, see ``independentlyRunnableSteps``.
318-
private func _independentlyRunnableSteps(in stepGraph: Graph<String, Step?>) -> [Step] {
319-
if let step = stepGraph.value {
320-
return [step]
321-
}
322-
return stepGraph.children.reduce(into: []) { result, childStepGraph in
323-
result += _independentlyRunnableSteps(in: childStepGraph.value)
324-
}
325-
}
326-
327-
/// The steps of the runner plan that can run independently of each other.
328-
///
329-
/// If a test is a child of another test, then it is dependent on that test
330-
/// to run. The value of this property is the set of steps that are _not_
331-
/// dependent on each other. For example, given the following structure:
332-
///
333-
/// ```swift
334-
/// struct A {
335-
/// @Suite struct B {
336-
/// @Test func c() {}
337-
/// @Test func d() {}
338-
/// struct E {
339-
/// @Test func f() {}
340-
/// }
341-
/// }
342-
/// ```
343-
///
344-
/// Only `B` and `E` are fully independent of any other tests. `c()` and
345-
/// `d()` are independent of each other, but both are dependent on `B`, and
346-
/// `f()` is dependent on `E`.
347-
public var independentlyRunnableSteps: [Step] {
348-
_independentlyRunnableSteps(in: stepGraph)
349-
}
350-
}
351-
352306
// MARK: - Snapshotting
353307

354308
extension Runner.Plan {

Tests/TestingTests/PlanTests.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -421,14 +421,6 @@ struct PlanTests {
421421
#expect(plan.stepGraph.subgraph(at: typeInfo.fullyQualifiedNameComponents + CollectionOfOne("reserved1(reserved2:)")) != nil)
422422
}
423423

424-
@Test("Runner.Plan.independentlyRunnableSteps property (all tests top-level)")
425-
func independentlyRunnableTests() async throws {
426-
let plan = await Runner.Plan(configuration: .init())
427-
for step in plan.independentlyRunnableSteps {
428-
#expect(step.test.id.nameComponents.count == 1, "Test is not top-level: \(step.test)")
429-
}
430-
}
431-
432424
@Test("Test cases of a disabled test are not evaluated")
433425
func disabledTestCases() async throws {
434426
var configuration = Configuration()

0 commit comments

Comments
 (0)