Skip to content

run

The run command runs tests with coverage instrumentation and generates a coverage profile, but does not evaluate policies. Use this when you only need the coverage data.

Terminal window
coverctl run [flags]

Alias: coverctl r

FlagDescriptionDefault
-c, --configConfig file path.coverctl.yaml
-p, --profileCoverage profile output path.cover/coverage.out
-d, --domainFilter to specific domain (repeatable)all domains
FlagDescription
--tagsBuild tags (e.g., integration,e2e)
--raceEnable race detector
--shortSkip long-running tests
-vVerbose test output
--runRun only tests matching pattern
--timeoutTest timeout (e.g., 10m, 1h)
--test-argAdditional go test argument (repeatable)
Terminal window
# Generate coverage profile
coverctl run
# Custom output path
coverctl run -p coverage.out
# Run only specific domains
coverctl run -d core -d api
Terminal window
# Run with integration build tag
coverctl run --tags integration
# Verbose output with extended timeout
coverctl run --tags integration -v --timeout 30m
Terminal window
# Run specific tests with race detector
coverctl run --run TestCriticalPath --race
# Pass extra arguments to go test
coverctl run --test-arg=-count=1 --test-arg=-parallel=4

The command generates a coverage profile file (default: .cover/coverage.out) in Go’s standard coverage format.

mode: atomic
github.com/user/project/internal/core/service.go:15.42,17.2 1 5
github.com/user/project/internal/core/service.go:19.52,23.16 3 2
...
Terminal window
# Generate profile for go tool cover
coverctl run -p coverage.out
go tool cover -html=coverage.out -o coverage.html
Terminal window
# Generate profile without policy enforcement
coverctl run -p artifacts/coverage.out
# Later, analyze with report command
coverctl report -p artifacts/coverage.out
CodeMeaning
0Coverage profile generated successfully
2Invalid configuration or arguments
3Test execution failed
  • check - Run coverage with policy enforcement
  • report - Analyze existing coverage profile
  • watch - Continuous coverage during development