Skip to content

Commit c934f1d

Browse files
committed
sweet: make it clear which benchmarks failed
Currently if there's a failure, you just get a message like "benchmarks failed to execute" but that's not very specific. It can make recent logs look like the culprit, when really it's further up in the log. Change-Id: Ib6ac96335b00418041495e5d1f9a6e2db920d387 Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/614315 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent 722bb6b commit c934f1d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sweet/cmd/sweet/run.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,18 @@ func (c *runCmd) Run(args []string) error {
379379
}
380380

381381
// Execute each benchmark for all configs.
382-
var errEncountered bool
382+
var failedBenchmarks []string
383383
for _, b := range benchmarks {
384384
if err := b.execute(configs, &c.runCfg); err != nil {
385385
if c.stopOnError {
386386
return err
387387
}
388-
errEncountered = true
388+
failedBenchmarks = append(failedBenchmarks, b.name)
389389
log.Error(err)
390390
}
391391
}
392-
if errEncountered {
393-
return fmt.Errorf("failed to execute benchmarks, see log for details")
392+
if len(failedBenchmarks) != 0 {
393+
return fmt.Errorf("failed to execute benchmarks: %s", strings.Join(failedBenchmarks, " "))
394394
}
395395
return nil
396396
}

0 commit comments

Comments
 (0)