Skip to content

Commit 7948e61

Browse files
author
Jeremi Piotrowski
committed
kola: Make RunTests return on runtime failures
So that the deferred flight.Destroy() is called. The only caller terminates the application on failure anyway.
1 parent 7429444 commit 7948e61

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

‎cmd/kola/kola.go‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,11 @@ func runRun(cmd *cobra.Command, args []string) {
134134

135135
// needs to be after RunTests() because harness empties the directory
136136
if err := writeProps(); err != nil {
137-
fmt.Fprintf(os.Stderr, "%v\n", err)
138-
os.Exit(1)
137+
plog.Fatal(err)
139138
}
140139

141140
if runErr != nil {
142-
fmt.Fprintf(os.Stderr, "%v\n", runErr)
143-
os.Exit(1)
141+
plog.Fatal(runErr)
144142
}
145143
}
146144

‎kola/harness.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func RunTests(patterns []string, channel, offering, pltfrm, outputDir string, ss
432432

433433
version, err := getClusterSemver(flight, outputDir)
434434
if err != nil {
435-
plog.Fatal(err)
435+
return fmt.Errorf("getClusterSemver: %w ", err)
436436
}
437437

438438
// If the version is > 3033, we can safely use user-data instead of custom-data for
@@ -453,7 +453,7 @@ func RunTests(patterns []string, channel, offering, pltfrm, outputDir string, ss
453453
// one more filter pass now that we know real version
454454
tests, err = FilterTests(tests, patterns, channel, offering, pltfrm, *version)
455455
if err != nil {
456-
plog.Fatal(err)
456+
return fmt.Errorf("FilterTests: %v", err)
457457
}
458458
}
459459

0 commit comments

Comments
 (0)