Go -short skipped all tests (empty run) - Fix in CI
testing.Short() lets a test skip itself in short mode. If every test guards on it, running with -short produces a green build that exercised nothing - a false pass that hides regressions.
What this error means
CI passes quickly but coverage is near zero and tests log --- SKIP. go test -short was used and every test calls t.Skip when testing.Short() is true.
go
--- SKIP: TestIntegration (0.00s)
main_test.go:10: skipping in short mode
PASS
ok example.com/app 0.005sCommon causes
-short used for the main run
The full CI job ran with -short, so every short-guarded test skipped.
All tests guard on Short()
Every test calls t.Skip in short mode, leaving nothing to run when -short is set.
How to fix it
Run the full suite without -short
- Use -short only for fast smoke jobs; run the real suite without it.
shell
go test ./...Separate fast and full jobs
- Keep a short smoke job and a separate full job so both paths run.
.github/workflows/ci.yml
- run: go test -short ./... # smoke
- run: go test ./... # fullHow to prevent it
- Reserve -short for fast smoke checks, not the gating run.
- Ensure at least one CI job runs the full suite.
- Fail the build if no tests actually executed.
Related guides
Go "testing: warning: no tests to run" - Fix in CIFix Go "testing: warning: no tests to run" in CI - the -run regexp matched nothing. Fix the pattern or the te…
Go "no test files" with -tags excluded - Fix in CIFix Go test seeing "no test files" because integration files are gated behind a build tag in CI - pass the ma…
Go "panic: test timed out" - Fix in CIFix Go "panic: test timed out after Xm" in CI - a test exceeded the -timeout budget. Fix the hang or raise th…