Skip to content
Latchkey

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.005s

Common 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

  1. Use -short only for fast smoke jobs; run the real suite without it.
shell
go test ./...

Separate fast and full jobs

  1. 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 ./...          # full

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →