mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-10 01:01:36 +00:00
Constrained tests tool implementation + skill (#5873)
* constrained tests tool implementation + skill * pr suggestions
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user