feat(cli): add --ignore-failure flag (#242)#286
feat(cli): add --ignore-failure flag (#242)#286yaowubarbara wants to merge 1 commit intoCodSpeedHQ:mainfrom
Conversation
|
@yaowubarbara thanks for the PR I think the idea is fine, but we should not do it at the executor level (valgrind/ walltime) As far as I see it, the only use case of the command failing would be when running outside of a codspeed integration, i.e when going through this That means that the allowing a non 0 exit code should be scoped to the exec-harness, so accept the cli flag only for |
Adds -i / --ignore-failure on the exec command, inspired by hyperfine. When set, a non-zero exit from the benchmarked process is logged as a warning and execution continues, instead of aborting. Reworked per review: the flag now lives in the exec-harness crate (where the user command is directly executed), not at the executor level. Scoped to codspeed exec only, not codspeed run. Closes CodSpeedHQ#242
82244cf to
51cffa2
Compare
|
Thanks for the review @GuillaumeLagrange! That makes total sense — the executor should stay strict since it's running exec-harness (or the instrumented command), and the tolerance belongs inside exec-harness where the user's command is directly invoked. Reworked:
Force-pushed with the rework. Let me know if there's anything else to adjust! |
Closes #242.
Adds
--ignore-failure(short-i) tocodspeed exec, inspired by hyperfine. When set, a non-zero exit status from the benchmarked command is logged as a warning instead of aborting the run.Reworked per review: the flag now lives in the exec-harness crate (where the user command is directly executed), not in the executor layer. This correctly scopes the tolerance to the wrapped command exit code.
Changes
exec-harness (
crates/exec-harness/):ignore_failurefield toBenchmarkCommand(flows via stdin JSON)--ignore-failure/-iCLI arg for direct invocationwalltime/benchmark_loop.rs: warn + continue instead of bail on non-zero exitanalysis/mod.rs: same forperform()andperform_with_valgrind()CLI (
src/):--ignore-failuretoExecArgsonly (not shared, not oncodspeed run)ignore_failure: booltoBenchmarkTarget::Execmulti_targets::build_exec_targets_pipe_command()into the JSON payloadWhy
execonly, notrun?codspeed runexpects a command with built-in CodSpeed instrumentation (pytest-codspeed, cargo-codspeed, etc.). If that command fails, it's a real test failure.codspeed execwraps arbitrary commands that may legitimately exit non-zero (interrupted servers, coverage harnesses, etc.).