From 67509e5e0502dbe68d9417158305be68ed05eca4 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Fri, 24 Jul 2026 11:06:54 +0200 Subject: [PATCH] acc: hard-fail when change detection diff fails Revert the fail-open from #6047 now that every caller (push.yml PR cells and integration runs) fetches origin/main. A failed `git diff --merge-base origin/main` should abort loudly instead of silently disabling change detection and letting new tests skip. --- acceptance/skiplocal_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/acceptance/skiplocal_test.go b/acceptance/skiplocal_test.go index a16de1f0ef..7f90653099 100644 --- a/acceptance/skiplocal_test.go +++ b/acceptance/skiplocal_test.go @@ -67,16 +67,14 @@ func selectChangedLocalTests(t *testing.T, testDirs map[string]bool) map[string] out, err := exec.Command("git", "diff", "--name-status", "--merge-base", "-M", "origin/main").Output() if err != nil { // A failed diff (most commonly a missing origin/main in a shallow CI - // checkout) disables change detection, so newly added tests fall back to - // the seeded subset and may not run. Log loudly but continue: failing the - // test here breaks integration runs whose checkout has no origin/main. The - // push.yml PR cells fetch full history so origin/main resolves there. + // checkout) must not be silently treated as "nothing changed": that + // disables change detection and lets newly added tests skip. Fail loudly. + // Every caller (push.yml PR cells, integration runs) now fetches origin/main. stderr := "" if exitErr, ok := errors.AsType[*exec.ExitError](err); ok { stderr = strings.TrimSpace(string(exitErr.Stderr)) } - t.Logf("WARNING: change detection disabled: git diff --merge-base origin/main failed: %v\n%s", err, stderr) - return nil + t.Fatalf("git diff --merge-base origin/main failed: %v\n%s", err, stderr) } diff := strings.TrimSpace(string(out))