Example test projects demonstrating Gaffer integration for various test frameworks.
Parser Check: January 22 2026 - 8:16am
| Framework | Report Formats | Directory |
|---|---|---|
| Jest | JSON, HTML | jest-example/ |
| pytest | HTML | pytest-example/ |
| Vitest | JSON | vitest-example/ |
| .NET (xUnit, NUnit, MSTest) | TRX | dotnet-examples/ |
- Node.js 22+ (Jest, Vitest)
- Python 3.9+ (pytest)
- Docker or .NET 8.0 SDK (xUnit, NUnit, MSTest)
- Gaffer Upload Token
cd jest-example
npm install
npm run test:all # Generates both JSON and HTML reportscd pytest-example
pip install -r requirements.txt
pytest --html=reports/pytest-report.html --self-contained-htmlcd vitest-example
npm install
npm run test:json # Generates JSON reportcd dotnet-examples
mkdir -p reports
docker run --rm -v "$(pwd):/app" -w /app mcr.microsoft.com/dotnet/sdk:8.0 sh -c "
dotnet restore && dotnet build && \
dotnet test tests/Calculator.XUnit.Tests --logger 'trx;LogFileName=xunit-results.trx' --results-directory ./reports && \
dotnet test tests/Calculator.NUnit.Tests --logger 'trx;LogFileName=nunit-results.trx' --results-directory ./reports && \
dotnet test tests/Calculator.MSTest.Tests --logger 'trx;LogFileName=mstest-results.trx' --results-directory ./reports
"- name: Upload to Gaffer
uses: gaffer-sh/gaffer-uploader@v0.4.0
with:
gaffer_upload_token: ${{ secrets.GAFFER_UPLOAD_TOKEN }}
report_path: reports/test-report.json
commit_sha: ${{ github.sha }}
branch: ${{ github.ref_name }}
test_framework: jestcurl -X POST https://app.gaffer.sh/api/upload \
-H "X-API-Key: $GAFFER_UPLOAD_TOKEN" \
-F "files=@reports/test-report.json" \
-F "commit_sha=$COMMIT_SHA" \
-F "branch=$BRANCH"Each example includes a GitHub Actions workflow that:
- Runs tests on push/PR to
main - Generates reports in the target format
- Uploads to Gaffer (both Action and curl examples)
- Stores artifacts for 30 days
See the workflows in .github/workflows/.
| Framework | Format | Output Path | Parser |
|---|---|---|---|
| Jest | JSON | reports/jest-results.json |
jest-json |
| Jest | HTML | reports/jest-report.html |
jest-html |
| pytest | HTML | reports/pytest-report.html |
pytest-html |
| Vitest | JSON | reports/vitest-results.json |
vitest-json |
| xUnit | TRX | reports/xunit-results.trx |
trx |
| NUnit | TRX | reports/nunit-results.trx |
trx |
| MSTest | TRX | reports/mstest-results.trx |
trx |
After a workflow run, you can download the test report artifacts:
- Go to the Actions tab in GitHub
- Select the workflow run
- Download artifacts from the "Artifacts" section
Or use the GitHub CLI:
gh run download <run-id> -n jest-reports-<sha>To use these examples with your own Gaffer project:
- Fork or clone this repository
- Add
GAFFER_UPLOAD_TOKENto your repository secrets - Push to trigger the workflows
MIT