Starting from a simple workflow that runs pytest, we want to
The native pytest JUnit XML is insufficient for Captain's functionality. In place of it, we recommend installing pytest-reportlog. Once installed, ensure pytest produces compatible output with:
pytest --report-log=tmp/log.json
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
.
See the full documentation on test suite integration.
- uses: rwx-research/setup-captain@v1
- name: Run tests
run: |
captain run \
--suite-id captian-examples-pytest \
--test-results tmp/log.json \
-- pytest --report-log=tmp/log.json
env:
RWX_ACCESS_TOKEN: ${{ secrets.RWX_ACCESS_TOKEN }}
Take a look at the final workflow!