RWX
RWX and Captain work together to run your tests and provide you with test result data directly in RWX.
Here, we'll walk through everything needed to integrate Captain with RWX:
Installing Captain
Add a task that uses the rwx/install-captain package to install the Captain CLI.
# .rwx/ci.yml
tasks:
- key: captain
call: rwx/install-captain 1.0.2
Integrating Captain with your test framework
Captain integrates with many test frameworks. [Find instructions for your specific test framework here.][captain-test-frameworks]
This example integrates with [Ruby's RSpec][ruby-rspec] but can be used as a baseline for integrating with a different framework.
# .captain/config.yml
test-suites:
captain-examples-rspec:
command: bundle exec rspec --format json --out rspec-results.json --format progress
results:
path: rspec-results.json
output:
print-summary: true
reporters:
rwx-v1-json: captain-results.json
# .rwx/ci.yml
tasks:
# ... tasks that clone your repo, setup Ruby, etc. here
- key: captain
call: rwx/install-captain 1.0.2
- key: rspec
use: captain # you'll likely also depend on your code, your Ruby dependencies, etc.
run: captain run captain-examples-rspec
outputs:
test-results:
- path: captain-results.json
Make sure to have Captain report rwx-v1-json
to a path specified in
outputs.test-results
. This will allow you to view your test results directly
in RWX!
There's no need to specify an RWX_ACCESS_TOKEN when using Captain with RWX. RWX automatically provides an access token to Captain with permissions to save test results to Captain Cloud.
Partitioning
Captain's partitioning feature works with RWX parallel tasks:
Start by updating your Captain configuration to enable partitioning as follows:
# .captain/config.yml
test-suites:
captain-examples-rspec:
# existing config...
partition:
command: bundle exec rspec --format json --out tmp/rspec.json --format progress {{ testFiles }}
globs:
- spec/**/*_spec.rb
And then use the parallel expressions to instruct Captain to run individual partitions.
# .rwx/ci.yml
tasks:
# ... tasks that clone your repo, setup Ruby, etc. here
- key: captain
call: rwx/install-captain 1.0.2
- key: rspec
use: captain # you'll likely also depend on your code, your Ruby dependencies, etc.
parallel: 2
run: captain run captain-examples-rspec --partition-index ${{ parallel.index }} --partition-total ${{ paralllel.total }}
outputs:
test-results:
- path: test-results.json
Viewing test results
RWX will display your test results directly in the UI:

Captain will also automatically output an RWX link linking to your test results inside of Captain, and the results in Captain will link back to RWX.
Retrying failed tests
If you configure Captain with a retry command, Captain will add a retry action to RWX allowing you to retry only the tests that failed.
If you are also using ABQ, you will need to supply the --local
flag to ABQ
in your retry command.