Skip to main content

JUnit XML & Allure Report Ingestion

Send the results of any test framework to Agnox by uploading the report it already writes. Maestro, Pytest, Selenium, WebdriverIO, Jest, JUnit/TestNG (Surefire), Cypress, Playwright and most other tools can write JUnit XML or Allure results. Agnox records each upload as one finished run, with the same failure analysis, flaky detection, quarantine and test case linking as runs from the Playwright reporter.

Playwright reporterReport upload
FrameworksPlaywrightAnything that writes JUnit XML or Allure results
When results arriveLive, while tests runOnce, after the run
Page context at failure (DOM, network, console)YesNo: what the report contains
SetupAdd the reporter to playwright.config.tsOne command after your test step

Uploaded runs are External CI runs (or Local runs with --local), count against the monthly external run quota, and are refused while External CI is turned off for your organization.


Upload with the CLI​

The agnox command comes with @agnox/mcp-server and needs Node.js 20 or later. Set AGNOX_API_KEY (an API key from Settings → My Profile → API keys, Developer or Admin role) and AGNOX_PROJECT_ID, then point it at your report:

# JUnit XML: a file, a directory (searched recursively for *.xml) or a .zip archive
npx -y @agnox/mcp-server@latest report upload build/test-results --tool maestro

# Allure: the allure-results directory
npx -y @agnox/mcp-server@latest report upload allure-results --format allure --tool pytest
Uploading 12 report files (84 KB)…
Run report-1764496800000-1a2b3c4d FAILED — JUnit XML: 148 tests, 145 passed, 2 failed, 1 skipped, 3 flaky in 4m 12s

The format is detected from the files. Pass --format junit or --format allure when a directory holds both kinds, or when a file has an unusual name.

OptionDescription
<path>...Required. Report files, directories or .zip archives. Several paths become one run.
--format <f>junit, allure or auto (default)
--project <id>Project to record the run in (default AGNOX_PROJECT_ID)
--branch <name>Git branch the tests ran on
--commit-sha <sha>Commit the tests ran against. Used by Root Cause Analysis to read the code from GitHub.
--repository <owner/repo>Repository of that commit
--pr <n>Pull request number
--run-url <url>Link back to the CI job
--ci <provider>github, gitlab, azure, bitbucket or jenkins
--no-ci-detectDon't read Git details from the CI platform's variables
--tool <name>Tool that produced the report, shown with the run (e.g. maestro, pytest, selenium)
--env <env>development, qa, staging or production (default). Default AGNOX_ENVIRONMENT when set
--group <name>Run group for the Dashboard's Grouped view. Default AGNOX_GROUP_NAME, else in GitHub Actions <workflow name> #<run number>, so every job of one pipeline (for example an Android and an iOS job) is grouped together. Not set automatically with --local or --no-ci-detect; --group "" turns it off.
--localRecord a Local run: kept out of pass rate, stability and flaky detection, and sent without CI details
--run-name <name>Name of the run, for example Android or iOS (default in GitHub Actions: the job id, GITHUB_JOB; --run-name "" turns it off); the Release Readiness Gate's required run names match it. Also names the Test Cycle created with --create-cycle
--create-cycle / --cycle <id>Create a Test Cycle for the run, or add the run to an existing one
--fail-on-failureExit with code 2 when the run failed
--jsonPrint the API result as JSON

Git details are picked up automatically on GitHub Actions, GitLab CI, Azure Pipelines, Bitbucket Pipelines and Jenkins: branch, commit, repository, pull request and a link to the job. Flags override what is detected.

Jobs of one GitHub Actions workflow run are grouped automatically as <workflow name> #<run number>, the same group the Playwright reporter uses, so a pipeline that uploads Maestro results from one job and reports Playwright from another shows up as one group in the Dashboard's Grouped view.

Which files are sent. From a directory or archive: *.xml for JUnit, *-result.json and *-container.json for Allure. Attachments (screenshots, videos, logs), environment.properties, executor.json and categories.json are never read or sent. A file you name directly is always sent. Symbolic links inside a directory are not followed.

Limits. At most 2,000 files, 20 MB per file and 40 MB in total per upload (50 MB once encoded), and 100 uploads per minute per organization. The stored results of one run (errors, output, metadata) must fit in 14 MB; a larger report is refused with a message to split it. .zip archives up to 200 MB are read without extracting them to disk; encrypted and ZIP64 archives are not supported (extract them and upload the directory).

Exit codes. 0 uploaded, 1 error (nothing was recorded), 2 uploaded and the run failed (only with --fail-on-failure). By default a failed run still exits 0, because your test step has usually failed the job already.


CI examples​

GitHub Actions​

- name: Run tests
run: pytest --junitxml=reports/junit.xml

- name: Upload results to Agnox
if: always() # upload failed runs too
run: npx -y @agnox/mcp-server@latest report upload reports --tool pytest
env:
AGNOX_API_KEY: ${{ secrets.AGNOX_API_KEY }}
AGNOX_PROJECT_ID: ${{ vars.AGNOX_PROJECT_ID }}

Android and iOS (or any set of devices). Upload each platform as its own run, with its own --run-name, so its tests are counted separately; uploading both reports together would merge the same flow into retries of one test. In GitHub Actions both runs join the workflow run's group without --group:

- name: Upload Android results
if: always()
run: npx -y @agnox/mcp-server@latest report upload android/report.xml --tool maestro --run-name Android --env qa
env:
AGNOX_API_KEY: ${{ secrets.AGNOX_API_KEY }}
AGNOX_PROJECT_ID: ${{ vars.AGNOX_PROJECT_ID }}

- name: Upload iOS results
if: always()
run: npx -y @agnox/mcp-server@latest report upload ios/report.xml --tool maestro --run-name iOS --env qa
env:
AGNOX_API_KEY: ${{ secrets.AGNOX_API_KEY }}
AGNOX_PROJECT_ID: ${{ vars.AGNOX_PROJECT_ID }}

To gate a release on these runs, follow them with agnox gate check --group "${{ github.workflow }} #${{ github.run_number }}". More workflows: GitHub Actions & CI/CD.

Outside GitHub Actions, pass the same --group to every upload of one pipeline, for example --group "Mobile $CI_PIPELINE_ID" on GitLab CI.

GitLab CI​

e2e:
script:
- maestro test flows/ --format junit --output report.xml
after_script:
- npx -y @agnox/mcp-server@latest report upload report.xml --tool maestro
# AGNOX_API_KEY and AGNOX_PROJECT_ID come from masked CI/CD variables

Jenkins​

post {
always {
sh 'npx -y @agnox/mcp-server@latest report upload target/surefire-reports --tool junit5'
}
}

Producing the report​

ToolCommand or setting
Maestromaestro test flows/ --format junit --output report.xml
Pytestpytest --junitxml=report.xml, or pytest --alluredir=allure-results with allure-pytest
Jestjest --reporters=default --reporters=jest-junit
WebdriverIOreporters: ['junit'] or ['allure'] in wdio.conf
JUnit / TestNG (Maven)Surefire writes target/surefire-reports/TEST-*.xml
Gradlebuild/test-results/test/*.xml
Selenium (any runner)The runner's JUnit or Allure output
Cypress--reporter junit
Playwrightreporter: [['junit', { outputFile: 'results.xml' }]] (or use the Playwright reporter for live results)

What is read from the report​

JUnit XML​

ReportAgnox
<testsuites> / <testsuite> (nested suites too)One run; suite names are kept for tests without a class
<testcase name classname file time>A test: title classname › name, spec file file (else the class name), duration from time (seconds)
<failure> / <error>Failed, with the message, type and stack trace as the error
<skipped>Skipped; the reason is kept as metadata
<system-out> / <system-err>The run's log
<properties> on a test caseMetadata; a tag or tags property becomes tags
Surefire <flakyFailure> / <flakyError>Earlier failed attempts of a test that passed: the test is flaky
Surefire <rerunFailure> / <rerunError>, or the same test listed againRetries of one test

A missing or malformed time counts as 0. Documents with a DOCTYPE or ENTITY declaration are refused.

Allure results​

ReportAgnox
*-result.jsonA test execution
statuspassed → passed, failed and broken → failed, skipped → skipped. An unknown status is recorded as skipped with a warning.
statusDetails.message and traceThe error
start / stopStart time and duration
parentSuite, suite, subSuite labelsThe title path
testClass / package label, or fullName before #The spec file
tag labels, and severityTags (severity:critical)
epic, feature, story, severity, owner labelsMetadata
parametersAdded to the title (name [browser=firefox]) and kept as metadata. masked values are stored as [REDACTED]; hidden and excluded parameters stay out of the title.
stepsTop-level step titles
historyIdResults with the same historyId are retries of one test, in start order
*-container.jsonA failed or broken fixture (befores / afters) explains the tests it covers that have no error of their own

Retries and run status​

Every attempt is stored, so the run drawer shows each retry. Attempts are matched by spec file (or class name) and title, so the same test appearing in several files of one upload, for example a Maestro flow run on Android and on iOS, is treated as retries of one test. Upload each device, browser or platform as its own run when they should be counted separately. A test counts once in the totals, with the result of its last attempt: a test that failed and then passed is flaky and does not fail the run. The run is FAILED when the last attempt of any test failed. As with the Playwright reporter, a run that failed only on quarantined tests is recorded as PASSED.

Test identity​

Each test gets the same stable test key the reporter uses, from its spec file (or class name) and title path. Re-uploading the same suite links results to the same test cases, so stability scores, flaky detection and quarantine work across uploads and across the reporter and report uploads.


Security and limits​

  • Secrets are redacted before anything is stored: tokens, JWTs, Authorization headers, cookies, secret URL parameters and credentials in URLs are removed from errors, output, titles, tags and metadata. Metadata whose name looks secret (password, token, api_key, …) is stored as [REDACTED].
  • The same limits as the Playwright reporter apply: errors are cut at 8 KB, up to 50 steps, 50 tags and 50 metadata entries per test, and the run log at 4 MB.
  • Nothing is written when a report is invalid. A malformed file, an empty report or an ambiguous upload is answered with a 400 that names the file (and the line, for XML) and is not counted against your quota.
  • Uploads are scoped to your organization: a project of another organization is 404.
  • Uploads go through the same API host as the rest of the API; if you run Agnox behind your own proxy, allow request bodies of at least 50 MB on /api/v1/reports.

Upload with the API​

The CLI calls POST /api/v1/reports. Send the files as text:

curl -X POST https://api.agnox.dev/api/v1/reports \
-H "x-api-key: $AGNOX_API_KEY" -H "content-type: application/json" \
-d @- <<EOF
{
"projectId": "$AGNOX_PROJECT_ID",
"format": "junit",
"tool": "maestro",
"branch": "main",
"commitSha": "a1b2c3d",
"files": [{ "name": "report.xml", "content": $(jq -Rs . < report.xml) }]
}
EOF
{
"success": true,
"data": {
"taskId": "report-1764496800000-1a2b3c4d",
"status": "FAILED",
"format": "junit",
"summary": { "total": 3, "passed": 1, "failed": 1, "skipped": 1, "flaky": 0, "attempts": 3, "durationMs": 3500 },
"quarantineBypassed": false,
"warnings": []
}
}

The run is recorded at upload time: it ends when the upload arrives and starts as long before as the report's tests took (at most 24 hours). Uploading an old report does not back-date the run to the day it originally ran.