- 🧪 Ensure minitest produces JSON output
By default, minitest does not include reporters that produce enough detail for Captain. We recommend installing the minitest-reporters gem and using it to produce JUnit output.
gem install minitest-reporters
# test_helper.rb
require "minitest/reporters"
Minitest::Reporters.use!(
[
Minitest::Reporters::DefaultReporter.new,
Minitest::Reporters::JUnitReporter.new("tmp/reports", true, single_file: true)
]
)
- 🔐 Create an Access Token
Create an Access Token for your organization within Captain (more documentation here).
Add the new token as an action secret to your repository. Conventionally, we call this secret RWX_ACCESS_TOKEN
.
- 💌 Install the Captain CLI, and then call it when running tests
See the full documentation on test suite integration.
- run: |
captain run \
--suite-id captain-examples-minitest \
--test-results "tmp/reports/*.xml" \
--language Ruby \
--framework minitest \
-- \
bundle exec rake
env:
RWX_ACCESS_TOKEN: ${{ secrets.RWX_ACCESS_TOKEN }}
- 🎉 See your test results in Captain!
Take a look at the final workflow!