JUnit XML
JUnit XML files could be converted to Flakiness Report via the Flakiness CLI. Once JUnit XML files are converted into a Flakiness Report, this report can be either viewed locally or uploaded.
To convert JUnit XML report(s) into a Flakiness report, run:
flakiness convert-junit <junit-root-dir-path>Options:
<junit-root-dir-path>- Path to JUnit XML file or directory containing XML files--output-dir <dir>- Output directory for the report (default:flakiness-report)--env-name <name>- Environment name for the report (default:junit)--commit-id <id>- Git commit ID (auto-detected if not provided)--project <org/project>- Flakiness.io project slug for OIDC uploads (env:FLAKINESS_PROJECT)
The command will:
- Read JUnit XML files (single file or recursively from a directory)
- Auto-detect the git commit ID from your repository (unless
--commit-idis provided) - Generate a Flakiness report and save it as
report.jsonin the specified output directory.
Example:
# Convert test results XML files into a Flakiness report.flakiness convert-junit ./test-results --env-name ci --output-dir ./flakiness-reportflakiness upload ./flakiness-reportCI/CD Integration
Section titled “CI/CD Integration”After your tests produce JUnit XML files, add steps to convert and upload them.
No secrets needed — requires --project and id-token: write permission. See the GitHub Actions guide for more details.
jobs: test: runs-on: ubuntu-latest permissions: contents: read # Required for actions/checkout id-token: write # Required for GitHub OIDC steps: - uses: actions/checkout@v4 # ... your test steps that produce JUnit XML ... - name: Install Flakiness CLI run: curl -LsSf https://cli.flakiness.io/install.sh | sh - name: Convert & upload run: | flakiness convert-junit ./test-results --project myorg/myproject flakiness upload ./flakiness-report/report.jsonUses a repository secret. See the GitHub Actions guide for setup.
jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # ... your test steps that produce JUnit XML ... - name: Install Flakiness CLI run: curl -LsSf https://cli.flakiness.io/install.sh | sh - name: Convert & upload env: FLAKINESS_ACCESS_TOKEN: ${{ secrets.FLAKINESS_ACCESS_TOKEN }} run: | flakiness convert-junit ./test-results flakiness upload ./flakiness-report/report.jsonSet FLAKINESS_ACCESS_TOKEN as an environment variable in your CI provider. See Other CI Providers for details.
curl -LsSf https://cli.flakiness.io/install.sh | shflakiness convert-junit ./test-resultsflakiness upload ./flakiness-report/report.json