From 4c68f7283f27b4131d0f63f0de13746bf46f1b67 Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Molins Date: Mon, 29 Jan 2024 12:00:32 +0100 Subject: [PATCH] Report could not find hits as test case error --- internal/testrunner/runners/system/runner.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/testrunner/runners/system/runner.go b/internal/testrunner/runners/system/runner.go index 121b66b9b0..e1ac80ee13 100644 --- a/internal/testrunner/runners/system/runner.go +++ b/internal/testrunner/runners/system/runner.go @@ -711,8 +711,7 @@ func (r *runner) runTest(config *testConfig, ctxt servicedeployer.ServiceContext } if !passed { - result.FailureMsg = fmt.Sprintf("could not find hits in %s data stream", dataStream) - return result.WithError(fmt.Errorf("%s", result.FailureMsg)) + return result.WithError(testrunner.ErrTestCaseFailed{Reason: fmt.Sprintf("could not find hits in %s data stream", dataStream)}) } logger.Debugf("check whether or not synthetics is enabled (component template %s)...", componentTemplatePackage) @@ -1341,7 +1340,6 @@ func (r *runner) generateTestResult(docs []common.MapStr, specVersion semver.Ver } func (r *runner) checkAgentLogs(dumpOptions stack.DumpOptions, startTesting time.Time, errorPatterns []logsByContainer) (results []testrunner.TestResult, err error) { - for _, patternsContainer := range errorPatterns { startTime := time.Now()