From 4d972103e7a1ed42ba93726930d7e82c137e129b Mon Sep 17 00:00:00 2001 From: Sabine Maennel <5292683+sabinem@users.noreply.github.com> Date: Fri, 21 Aug 2026 11:24:46 +0200 Subject: [PATCH] fix(just): clear stale Go coverage data before running tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `go tool covdata` merges every covmeta in .output//coverage/data, and the directory is never cleared. Run the tests on one branch and then on another and the merged profile still names source files that only existed on the first, so `go tool cover -html` fails reading them — every spec passes and the target still goes red. Drop the directory before delegating to quitsh. The run about to happen regenerates all of it. CI gets a fresh workspace, so this only ever bit locally, after a branch switch. The proper fix is for quitsh's test-go runner to clear GOCOVERDIR itself, but that runner lives upstream in sdsc-ordes/quitsh. --- tools/just/check.just | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/just/check.just b/tools/just/check.just index d83b2e74..cf765582 100644 --- a/tools/just/check.just +++ b/tools/just/check.just @@ -37,7 +37,19 @@ build *args: # Run tests for a component. Usage: just check::test -c frontend [group('checks')] test *args: - cd "{{root_dir}}" && just quitsh test "$@" + #!/usr/bin/env bash + set -eu + cd "{{root_dir}}" + # Go coverage data accumulates in this directory across runs, and + # `go tool covdata` merges every covmeta it finds there. Run the tests on + # one branch and then on another, and the merged profile still names source + # files that only existed on the first — at which point `go tool cover + # -html` fails reading them and the whole test target goes red with every + # spec passing. CI gets a fresh workspace, so this only ever bites locally, + # after a branch switch. Dropping the directory costs nothing: the run + # about to happen regenerates all of it. + rm -rf .output/*/coverage/data + just quitsh test "$@" # Lint a component. Usage: just check::lint -c backend [group('checks')]