Skip to content

Build Flags

coverctl supports common test flags for customizing test execution. These flags are available on the check, run, and watch commands. The flags below apply to Go projects; other languages use their native test runners with equivalent options passed via --test-arg.

FlagDescriptionExample
--tagsBuild tags--tags integration,e2e
--raceEnable race detector--race
--shortSkip long-running tests--short
-vVerbose test output-v
--runRun tests matching pattern--run TestFoo
--timeoutTest timeout--timeout 30m
--test-argAdditional go test argument--test-arg=-count=1

Run tests with specific build tags:

Terminal window
# Run integration tests
coverctl check --tags integration
# Multiple tags
coverctl check --tags integration,e2e
# Unit tests only (exclude integration)
coverctl check --tags !integration
//go:build integration
package mypackage_test
func TestIntegration(t *testing.T) {
// This test only runs with --tags integration
}
Terminal window
coverctl check --tags integration --timeout 30m

Enable the Go race detector:

Terminal window
coverctl check --race

Skip long-running tests marked with t.Short():

Terminal window
coverctl check --short
func TestSlow(t *testing.T) {
if testing.Short() {
t.Skip("skipping slow test")
}
// Long-running test code
}

Show detailed test output:

Terminal window
coverctl check -v

Useful for debugging test failures.

Run only tests matching a regex pattern:

Terminal window
# Run specific test
coverctl check --run TestValidate
# Run tests matching pattern
coverctl check --run "TestUser.*"
# Run subtests
coverctl check --run "TestValidate/empty_input"

Set test execution timeout:

Terminal window
# 30 minutes
coverctl check --timeout 30m
# 1 hour
coverctl check --timeout 1h
# 90 seconds
coverctl check --timeout 90s

Default Go timeout is 10 minutes. Increase for:

  • Integration tests
  • Tests with external dependencies
  • Tests with race detection

Pass extra arguments directly to go test:

Terminal window
# Disable test caching
coverctl check --test-arg=-count=1
# Set parallelism
coverctl check --test-arg=-parallel=4
# Multiple arguments
coverctl check --test-arg=-count=1 --test-arg=-parallel=4
# Enable CPU profiling
coverctl check --test-arg=-cpuprofile=cpu.out
Terminal window
# Quick unit tests only
coverctl watch --short -d core
Terminal window
# Full test suite with race detection
coverctl check --race --timeout 30m --ci
Terminal window
# Run integration tests with extended timeout
coverctl check --tags integration --timeout 1h -v
Terminal window
# Verbose output for specific test
coverctl check --run TestFailing -v --test-arg=-count=1
Terminal window
# Limit parallel test execution
coverctl check --test-arg=-parallel=2

Flags can be combined for complex scenarios:

Terminal window
# Integration tests with race detection, verbose, extended timeout
coverctl check \
--tags integration \
--race \
-v \
--timeout 1h \
--test-arg=-parallel=4
- name: Run integration tests
run: |
coverctl check \
--tags integration \
--timeout 30m \
--ci
- name: Run with race detector
run: |
coverctl check \
--race \
--timeout 20m \
--ci
  • check - Check command reference
  • run - Run command reference
  • watch - Watch command reference