Skip to content

Migrating from JUnit XML

You'll need
  • a JUnit XML report from any runner
  • for the CI half of the guide: a GitHub repository with GitHub Actions
You'll have
  • your JUnit-producing runner uploading reports to Flakiness.io on every push and PR.

Many test runners speak JUnit XML even when they have no native Flakiness reporter. The flakiness convert-junit CLI command bridges the gap: feed it JUnit XML, get a Flakiness report out.

  1. Install the Flakiness CLI (see CLI Overview for OS-specific install commands).

  2. Convert your JUnit XML into a Flakiness report. Point at a single XML file or a directory (it recurses):

    Terminal window
    flakiness convert-junit ./test-results

    This produces a flakiness-report/ directory with a report.json inside. Common options:

    • --output-dir <dir> — write the report somewhere other than flakiness-report/
    • --title "My Suite" — give the run a human-readable title (see Naming Runs)
    • --commit-id <sha> — override the auto-detected git commit
  3. View it in the browser:

    Terminal window
    flakiness show ./flakiness-report

Once the conversion works locally, wire it into CI.

The example below uses GitHub Actions. The flakiness convert-junit + flakiness upload pattern works on any CI provider — only the authentication plumbing changes.

.github/workflows/tests.yml
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout
id-token: write # for Flakiness.io OIDC
steps:
- uses: actions/checkout@v4
# ... your usual test steps that produce JUnit XML ...
- name: Install Flakiness CLI
run: curl -LsSf https://cli.flakiness.io/install.sh | sh
- name: Convert JUnit XML & upload
run: |
flakiness convert-junit ./test-results --project my-org/my-app
flakiness upload ./flakiness-report/report.json

The --project flag (equivalent to FLAKINESS_PROJECT env var) tells the CLI which Flakiness.io project to upload to. With id-token: write permission, OIDC handles authentication, so no secrets are required.