Constrained tests tool implementation + skill (#5873)

* constrained tests tool implementation + skill

* pr suggestions
This commit is contained in:
Mauro
2026-07-15 12:17:51 +02:00
committed by GitHub
parent 1062e2c6dd
commit 0be5693779
4 changed files with 94 additions and 2 deletions
+9
View File
@@ -39,6 +39,9 @@ struct RunTests: AsyncParsableCommand {
@Option(help: "Only run a specific test (format: 'ClassName/testName').")
var testName: String?
@Flag(help: "Run the tests on a saturated CPU to reproduce the flakiness of a busy CI runner.")
var constrained = false
private var isCI: Bool {
ProcessInfo.processInfo.environment["CI"] != nil
}
@@ -73,6 +76,12 @@ struct RunTests: AsyncParsableCommand {
let outputDirectory = resultBundleURL.deletingLastPathComponent()
try FileManager.default.createDirectory(at: outputDirectory, withIntermediateDirectories: true)
let cpuConstraint = CPUConstraint()
if constrained {
cpuConstraint.start()
}
defer { cpuConstraint.stop() }
try await executeXcodeBuild()
try await shutdownSimulator()