Skip to content

ccjs run workers

Run tests in parallel across multiple worker processes for dramatically faster CI pipelines.

Usage

bash
ccjs run workers [options]

How It Works

The workers command automatically detects the number of available CPU cores and distributes tests across parallel worker processes. This can reduce test suite execution time by 50–80% in CI.

Flags

FlagShortDescription
--count <n>Number of workers (default: auto-detect CPU count)
--by <strategy>Distribution strategy: pool, suite, or test
--grep <pattern>-gFilter tests by name or tag
--config <path>-cSpecify a custom config file

Distribution Strategies

StrategyDescriptionBest For
pool (default)Dynamic load balancing across workersMost projects
suiteGroup tests by suite fileShared browser state
testDistribute individual test casesLarge, uniform test files

Examples

bash
# Auto-detect CPU count, pool strategy (recommended)
ccjs run workers

# Specify 4 workers explicitly
ccjs run workers --count 4

# Use suite-based distribution
ccjs run workers --by suite

# Run only smoke tests in parallel
ccjs run workers --grep "@smoke"

WARNING

Workers run tests in separate processes. Ensure your tests are independent and don't share state (e.g., database records, files).

Released under the MIT License. Built with ❤️ on top of CodeceptJS.