Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 1.69 KB

README.md

File metadata and controls

55 lines (41 loc) · 1.69 KB

Getting Captain working with minitest

  1. 🧪 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)
  ]
)
  1. 🔐 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.

  1. 💌 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 }}
  1. 🎉 See your test results in Captain!

Take a look at the final workflow!