mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-07-12 19:04:49 +00:00
27c9415193
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)
13 lines
703 B
Go
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
|