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.
coverctl run [flags]Alias: coverctl r
Configuration
Section titled “Configuration”| Flag | Description | Default |
|---|---|---|
-c, --config | Config file path | .coverctl.yaml |
-p, --profile | Coverage profile output path | .cover/coverage.out |
-d, --domain | Filter to specific domain (repeatable) | all domains |
Build/Test Flags
Section titled “Build/Test Flags”| Flag | Description |
|---|---|
--tags | Build tags (e.g., integration,e2e) |
--race | Enable race detector |
--short | Skip long-running tests |
-v | Verbose test output |
--run | Run only tests matching pattern |
--timeout | Test timeout (e.g., 10m, 1h) |
--test-arg | Additional go test argument (repeatable) |
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”# Generate coverage profilecoverctl run
# Custom output pathcoverctl run -p coverage.out
# Run only specific domainscoverctl run -d core -d apiIntegration Tests
Section titled “Integration Tests”# Run with integration build tagcoverctl run --tags integration
# Verbose output with extended timeoutcoverctl run --tags integration -v --timeout 30mAdvanced Options
Section titled “Advanced Options”# Run specific tests with race detectorcoverctl run --run TestCriticalPath --race
# Pass extra arguments to go testcoverctl run --test-arg=-count=1 --test-arg=-parallel=4Output
Section titled “Output”The command generates a coverage profile file (default: .cover/coverage.out) in Go’s standard coverage format.
mode: atomicgithub.com/user/project/internal/core/service.go:15.42,17.2 1 5github.com/user/project/internal/core/service.go:19.52,23.16 3 2...Use Cases
Section titled “Use Cases”Generate Profile for External Tools
Section titled “Generate Profile for External Tools”# Generate profile for go tool covercoverctl run -p coverage.outgo tool cover -html=coverage.out -o coverage.htmlCI Artifact Generation
Section titled “CI Artifact Generation”# Generate profile without policy enforcementcoverctl run -p artifacts/coverage.out
# Later, analyze with report commandcoverctl report -p artifacts/coverage.outExit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Coverage profile generated successfully |
2 | Invalid configuration or arguments |
3 | Test execution failed |