From d4b87eb699258792a36391265442b6066c588b19 Mon Sep 17 00:00:00 2001 From: Adi Muraru Date: Wed, 12 Aug 2026 12:16:49 +0200 Subject: [PATCH] test(e2e): print a running "[k/N] specs done" progress counter The e2e suite runs --ginkgo.v but Ginkgo only prints the spec count up front ("Will run N of N specs") and a final summary, so CI logs give no indication of progress while the ~45m run is in flight. Add a ReportBeforeSuite hook to capture the total spec count and a ReportAfterEach hook that prints "[k/N specs done] : (took )" after every spec, so progress and per-spec timing can be read straight off the CI log. --- tests/e2e/koperator_suite_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/e2e/koperator_suite_test.go b/tests/e2e/koperator_suite_test.go index 189f41305..bf4e4d5f8 100644 --- a/tests/e2e/koperator_suite_test.go +++ b/tests/e2e/koperator_suite_test.go @@ -18,6 +18,7 @@ package e2e import ( + "fmt" "testing" "github.com/gruntwork-io/terratest/modules/k8s" @@ -31,6 +32,21 @@ func TestKoperator(t *testing.T) { ginkgo.RunSpecs(t, "Koperator end to end test suite") } +// totalSpecsToRun and completedSpecCount back the "[k/N]" progress line printed after each spec below. +// The suite runs in series (no -p/--procs), so plain package vars are safe without synchronization. +var totalSpecsToRun int +var completedSpecCount int + +var _ = ginkgo.ReportBeforeSuite(func(report ginkgo.Report) { + totalSpecsToRun = report.PreRunStats.SpecsThatWillRun +}) + +var _ = ginkgo.ReportAfterEach(func(report ginkgo.SpecReport) { + completedSpecCount++ + fmt.Printf("--- [%d/%d specs done] %s: %s (took %s)\n", + completedSpecCount, totalSpecsToRun, report.FullText(), report.State, report.RunTime) +}) + var _ = ginkgo.BeforeSuite(func() { ginkgo.By("Acquiring K8s cluster") var kubeconfigPath string