-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
If you codspeed run on a Go module with no benchmarks it will fail cryptically:
❯ codspeed run --mode walltime --skip-upload -- 'go test -bench=. ./...'
►►► Preparing the environment
Tool already installed, skipping installation
Sudo privileges are required to continue. Please enter your password.
[sudo] password for pablo.baeyens:
Environment ready
►►► Running the benchmarks
[INFO codspeed_go_runner] Discovered 0 packages
[INFO codspeed_go_runner] Total benchmarks discovered: 0
[INFO codspeed_go_runner] Parsed 0 raw results
Perf is enabled, but failed to detect benchmarks. If you wish to disable this warning, set CODSPEED_PERF_ENABLED=false
Error: Failed to copy log file
Error: No such file or directory (os error 2)
and if you codspeed run on a Go module with all benchmarks skipped it will panic:
❯ codspeed run --mode walltime --skip-upload -- 'go test -bench=. ./...'
►►► Preparing the environment
Tool already installed, skipping installation
Environment ready
►►► Running the benchmarks
[INFO codspeed_go_runner] Discovered 1 packages
[INFO codspeed_go_runner] Total benchmarks discovered: 1
[INFO codspeed_go_runner] Found BenchmarkSkip in "profiles_test.go"
[INFO codspeed_go_runner] Generating custom runner for package: xexporterhelper
[INFO codspeed_go_runner] Building binary for package: xexporterhelper
PASS
[INFO codspeed_go_runner] Parsed 0 raw results
⠂ Running the benchmarks...
thread 'main' panicked at src/run/runner/wall_time/perf/mod.rs:491:33:
called `Result::unwrap()` on an `Err` value: No such file or directory (os error 2)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The former I can identify with go test ./... -list=Benchmark | grep -q Benchmark but the latter I cannot: since benchmarks can be skipped in an arbitrary fashion I cannot determine statically what benchmarks would be run in the general case.
It would be useful if, when the runner parses 0 results, the error is a bit more descriptive and the exit code is 0 (or it is configurable to be zero).
GuillaumeLagrange and not-matthias
Metadata
Metadata
Assignees
Labels
No labels