#19: locate the repository root by a file that is actually committed

The E2E suite has never run in CI. repoRoot() walked up looking for
PLAN.md, but .gitignore excludes PLAN.md on purpose ("Internal planning
docs - never published with the code"), so it is absent from every fresh
checkout and the helper always failed. All twelve E2E tests died on it,
in this run and identically in #18 before any of these changes.

The marker is now the migrations directory, which is committed and is
what every caller of repoRoot is ultimately looking for.

Reproduced by exporting the tree with git archive - which yields exactly
what actions/checkout puts on the runner - and running the suite there:
it fails with the old helper and passes with the new one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Lucas RayanandClaude Opus 5 committed 2026-08-02 08:07:59 -03:00
1 parent d9fb6737d5
commit a9960d1c7c
1 file changed
+7 -2
@@ -270,12 +270,17 @@ func repoRoot(t *testing.T) string {
if err != nil {
t.Fatal(err)
}
// The marker is the migrations directory, which is what every caller is
// ultimately after. It used to be PLAN.md - a file .gitignore excludes on
// purpose ("never published with the code"), so it does not exist in a
// fresh checkout and this helper could never succeed in CI. That failure
// took the entire E2E suite down on every run.
for i := 0; i < 8; i++ {
if _, err := os.Stat(filepath.Join(dir, "PLAN.md")); err == nil {
if info, err := os.Stat(filepath.Join(dir, "migrations")); err == nil && info.IsDir() {
return dir
}
dir = filepath.Dir(dir)
}
t.Fatal("could not locate repository root (PLAN.md)")
t.Fatal("could not locate repository root (no migrations directory in any parent)")
return ""
}