Repository navigation
fix(ci): capture and surface ginkgo errors in run-coverage.sh - #12765
Merged
Merged
Conversation
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 <mudler@localai.io>
mudler
force-pushed
the
fix/coverage-error-visibility
branch
from
October 18, 2026 23:43
7098d02 to
d6fd45a
Compare
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 <mudler@localai.io>
Commit 9ad7838 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 <mudler@localai.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
scripts/run-coverage.shran ginkgo per test root with|| fail=1, which swallowed the exit code. Combined withmake --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 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.
Why
The
testsworkflow has been failing on every master push and every PR since commit9ad78381d8(Oct 16). All Ginkgo suites reportSUCCESS! -- 0 Failed, butgo run ginkgofor one root exits with code 1 and the error is completely invisible. This PR makes the error visible so the root cause can be diagnosed and fixed.How to verify
testsCI job on this PR will either pass (if the error was environmental) or show the actual ginkgo error in the log.GINKGO_TAGS="debug auth" COVERAGE_COVERPKG="github.com/mudler/LocalAI/pkg/..." scripts/run-coverage.sh /tmp/cov /tmp/cov/merged.out 1 ./pkg/model— should run ginkgo, show test output, and merge coverprofiles.run-coverage: ginkgo failed for <root> (exit N)header.