From 36170e8748d451a2f7eae4bf344b3360ba616d06 Mon Sep 17 00:00:00 2001 From: James Tumber Date: Thu, 28 Sep 2023 11:05:13 +0100 Subject: [PATCH] Remove [It] prefix for E2E_FOCUS Currently the `--rerun-failed` flag doesn't work with the `[It]` prefix included in the test name Fixes: #1925 Signed-off-by: James Tumber --- cmd/sonobuoy/app/results.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/sonobuoy/app/results.go b/cmd/sonobuoy/app/results.go index 4a34084bd..11907a744 100644 --- a/cmd/sonobuoy/app/results.go +++ b/cmd/sonobuoy/app/results.go @@ -523,7 +523,9 @@ func walkForSummary(result *results.Item, statusCounts map[string]int, failList statusCounts[result.Status]++ if result.Status == results.StatusFailed || result.Status == results.StatusTimeout { - failList = append(failList, result.Name) + // Ginkgo prefixes [It] to the test results name in the junit.xml (ginkgo/#1277) + // The -focus flag does not match test names with [It] flag, we must manually strip it + failList = append(failList, strings.TrimPrefix(result.Name, "[It]")) } return statusCounts, failList