Testing¶
Unit tests¶
Tests run with the race detector and write a coverage profile. Domain, config, and adapter logic carry table-driven tests (e.g. scantasks, repocfg, crapreport, result_store, repo_config_store).
End-to-end tests¶
The repocache package has a gated end-to-end test that exercises the real adapters: Postgres lock store, on-disk git clone, real go test -coverprofile, and a real go-crap scan.
# requires a reachable Postgres (GCT_E2E_DSN) and the go-crap binary
go test -tags e2e ./internal/adapters/secondary/repocache/
The e2e build tag keeps this out of the default go test ./... run.
Coverage¶
Or make test-coverage.