Summary
The tagged e2e suite cannot start on main. TestMain calls loadDotEnv(nil),
and loadDotEnv calls t.Log on the nil testing.TB when it walks past the
repo root without finding .env.test, so the process panics before any test
runs.
Repro
go test -tags=e2e ./internal/e2e/
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=...]
goroutine 1 [running]:
moonbridge/internal/e2e_test.loadDotEnv({0x0, 0x0})
internal/e2e/e2e_test.go:235
moonbridge/internal/e2e_test.TestMain(...)
internal/e2e/e2e_test.go:145
Root cause
e2e_test.go:145 passes nil to loadDotEnv, and e2e_test.go:235 calls
t.Log(".env.test not found — relying on OS env vars") unconditionally. Any run
that reaches the repo-root branch panics on the nil TB.
Fix
Guard the log call:
if t != nil {
t.Log(".env.test not found — relying on OS env vars")
}
Related
Summary
The tagged e2e suite cannot start on
main.TestMaincallsloadDotEnv(nil),and
loadDotEnvcallst.Logon the niltesting.TBwhen it walks past therepo root without finding
.env.test, so the process panics before any testruns.
Repro
go test -tags=e2e ./internal/e2e/Root cause
e2e_test.go:145passesniltoloadDotEnv, ande2e_test.go:235callst.Log(".env.test not found — relying on OS env vars")unconditionally. Any runthat reaches the repo-root branch panics on the nil TB.
Fix
Guard the log call:
Related
tool-use and multi-plugin hook coverage).
run; extracting it here lets fix: preserve Responses reasoning stream lifecycle #103 drop an unrelated file change.