Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(minor): Make CI fail with regression for crashes or other run failures #211

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Plugins/BenchmarkTool/BenchmarkTool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ struct BenchmarkTool: AsyncParsableCommand {
// check what failed and react accordingly
switch exitCode {
case .benchmarkJobFailed:
if baselineOperation == .check { // We need to fail with exit code for the baseline checks such that CI fails properly
exitBenchmark(exitCode: .thresholdRegression)
}
if let failedBenchmark {
failedBenchmarkList.append(failedBenchmark)
}
Expand All @@ -143,9 +146,12 @@ struct BenchmarkTool: AsyncParsableCommand {

func printChildRunError(error: Int32, benchmarkExecutablePath: String) {
print("Failed to run '\(command)' for \(benchmarkExecutablePath), error code [\(error)]")
print("Likely your benchmark crahed, try running the tool in the debugger, e.g.")
print("Likely your benchmark crashed, try running the tool in the debugger, e.g.")
print("lldb \(benchmarkExecutablePath)")
print("Or check Console.app for a backtrace if on macOS.")
if baselineOperation == .check { // We need to fail with exit code for the baseline checks such that CI fails properly
exitBenchmark(exitCode: .thresholdRegression)
}
}

func shouldIncludeBenchmark(_ name: String) throws -> Bool {
Expand Down
Loading