Skip to content

Commit 39b7476

Browse files
committed
fix(benchstat): use CombinedOutput for better error reporting
1 parent 6dcb581 commit 39b7476

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/scw-benchstat/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ func compareWithBaseline(cfg config, baselineFile, newResults string) error {
231231

232232
// Run benchstat comparison
233233
cmd := exec.Command("benchstat", "-format=csv", baselineFile, tmpFile.Name())
234-
output, err := cmd.Output()
234+
output, err := cmd.CombinedOutput()
235235
if err != nil {
236-
return fmt.Errorf("failed to compare with benchstat for %s: %w", filepath.Dir(baselineFile), err)
236+
return fmt.Errorf("failed to compare with benchstat for %s: %w\nOutput: %s", filepath.Dir(baselineFile), err, output)
237237
}
238238

239239
// Parse CSV output and check for regressions

0 commit comments

Comments
 (0)