As of Captain 1.11.0 you can use
captain run with
Partition your test suite leveraging test file timings.
captain partition [suite-id] [flags]
Feeding partition into
test_files=$( captain partition example-suite-id \ --index
\ --total \ "spec/**/*_spec.rb" ) captain run example-suite-id $test_files
Running an individual partition:
bundle exec rspec $(captain partition your-project-rspec spec/**/*_spec.rb --index 0 --total 2)
Displays help for partition command.
Required. The identifier of the test suite. This value should be unique to your Captain organization. It can also be set with the environment variable
--suite-id nor the environment variable
CAPTAIN_SUITE_ID are specified, then the first positional argument will be treated as the suite ID. For example, if you run
captain partition example-suite-id then
example-suite-id will be used for the suite ID.
Default: " " (space). The delimiter used to separate partitioned files in the output.
It can also be set with the environment variable
Required. 0-indexed index of a particular partition.
Can be set with
Sometimes Required. The git commit sha hash of the commit being built
If using a supported CI provider, this will be set automatically.
Otherwise, you may use this flag or set the environment variable
Required. The total number of partitions.
This can also be set with the environment variable