Starting from a simple workflow that runs xunit, we want to
Ensure your project includes the XunitXml.TestLogger
test logger
dotnet add package XunitXml.TestLogger --version 3.0.70
And use it with xunit test --logger xunit
. Note: you can also change the outputted filename.
dotnet test --logger "xunit;LogFileName=TestResults.xml" --results-directory "TestResults"
Note: We've specified the filename and results directory here, however TestResults/TestResults.xml
is also the default
result path
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-xunit2 \
--test-results TestResults/TestResults.xml \
-- dotnet test --logger "xunit;LogFileName=TestResults.xml" --results-directory "TestResults"
env:
RWX_ACCESS_TOKEN: ${{ secrets.RWX_ACCESS_TOKEN }}
Take a look at the final workflow!