From 48f358dd95646b6e2424111c1fdd27aa99e38b01 Mon Sep 17 00:00:00 2001 From: mudler-agent Date: Mon, 19 Oct 2026 08:09:26 +0200 Subject: [PATCH] fix(ci): capture and surface ginkgo errors in run-coverage.sh (#12765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(ci): capture and surface ginkgo errors in run-coverage.sh The coverage script ran ginkgo per test root with `|| fail=1`, which swallowed the exit code. Combined with `make --output-sync=target`, which buffers all output and flushes at the end, the actual ginkgo error was invisible in interleaved CI logs. Every test suite passed but the script still exited 1, and the error message was buried in 22 000 lines of buffered output. Each ginkgo invocation now captures combined stdout+stderr to a per-root log file. On failure the last 80 lines are printed to stderr so the error is visible in the CI log. On success the log is replayed to stdout so test output remains visible. The build flags (--tags, --coverpkg) are quoted correctly so values containing spaces (e.g. --tags="debug auth") are preserved through eval. Signed-off-by: Ettore Di Giacinto * fix(ci): create output dir before writing ginkgo logs The previous commit added per-root log files but forgot to create the output directory before the first ginkgo invocation. On CI the coverage/ dir did not exist yet, so the shell redirect to cover-pkg.out.log failed with "No such file or directory" before ginkgo even ran. Signed-off-by: Ettore Di Giacinto * test(core/http): add canvas preview route to auth coverage allowlist Commit 9ad78381d8 added GET /api/canvas/preview/:id as a public route (no auth — the random id is the capability, an iframe cannot send API key headers) but did not add it to expectedPublicRoutes in the route auth coverage test. The test flagged the route as an anonymous-access leak, failing the entire ./core ginkgo suite on every CI run since. The POST /api/canvas/preview endpoint is auth-gated (returns 401 to anonymous requests) and is intentionally absent from the allowlist. Signed-off-by: Ettore Di Giacinto --------- Signed-off-by: Ettore Di Giacinto Co-authored-by: Ettore Di Giacinto --- core/http/route_coverage_test.go | 4 + scripts/run-coverage.sh | 183 ++++++++++++++++++++----------- 2 files changed, 120 insertions(+), 67 deletions(-) diff --git a/core/http/route_coverage_test.go b/core/http/route_coverage_test.go index 61c2db65a..e360d1f7b 100644 --- a/core/http/route_coverage_test.go +++ b/core/http/route_coverage_test.go @@ -136,6 +136,10 @@ var _ = Describe("Route auth coverage", func() { {method: http.MethodGet, path: "/locales/*"}: {}, {method: http.MethodGet, path: "/static/*"}: {}, + // Canvas preview frames: the random id is the capability + // (an