From d757bfad1141464e929f5a43deec2dfc5b2365f4 Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Molins Date: Thu, 18 Apr 2024 10:35:36 +0200 Subject: [PATCH] Restore append before checking error --- cmd/testrunner.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/testrunner.go b/cmd/testrunner.go index 5d8ad8dd6..578f70aa1 100644 --- a/cmd/testrunner.go +++ b/cmd/testrunner.go @@ -365,11 +365,15 @@ func testTypeCommandActionFactory(runner testrunner.TestRunner) cobraext.Command RunTestsOnly: runTestsOnly, RunIndependentElasticAgent: runIndependentElasticAgent, }) + + // Results must be appended even if there is an error, since there could be + // tests (e.g. system tests) that return both error and results. + results = append(results, r...) + if err != nil { return fmt.Errorf("error running package %s tests: %w", testType, err) } - results = append(results, r...) } format := testrunner.TestReportFormat(reportFormat)