Files
goclaw/internal/testutil/doc.go
T
viettranx 27c9415193 build(ci): add coverage ratchet gate with per-package floors
Add automated coverage floor validation:
- scripts/check_coverage.go: parses coverage.out, compares to per-package
  thresholds, supports --update to lock current floors
- scripts/coverage_thresholds.json: 61 packages, initial floors from Phase 1
- .github/workflows/ci.yaml: new 'Coverage ratchet gate' step in CI
- internal/testutil/: test utilities (context builders, TestDB, doc.go)
2026-04-11 21:22:23 +07:00

13 lines
703 B
Go

// Package testutil provides reusable helpers for Go tests across the codebase.
//
// The package is split into default-build files (context builders, mock hooks)
// and integration-tagged files (DB connection helper) so default `go test ./...`
// never requires Postgres. Import paths stay consistent regardless of build tag.
//
// Helpers:
// - TestDB (integration tag): shared Postgres connection + migrations, once per binary.
// - TenantCtx / UserCtx / AgentCtx / FullCtx: context builders mirroring store.With* setters.
// - Mock stores (generated via go:generate, see generate.go): gomock doubles
// for unit tests that need a store interface without hitting Postgres.
package testutil