Skip to main content
Ask AI

Report Enrichment

testrelic-pytest can automatically enrich its results with data from Allure and JUnit reports produced during the same run. When enrichment is on, each uploaded test carries the extra structure those reporters captured — steps, attachments, severity, labels, and richer failure detail — without any code changes.

How it works

At the end of the session the plugin looks for report output to merge:

  • an Allure results directory (the one you pass to --alluredir), or
  • a JUnit XML file.

When it finds one, it reads each entry and merges the matching data onto the corresponding TestRelic result. Allure and JUnit data are combined per test, so you can run both and get the union.

Enrichment is enabled by default. It is best-effort: if no report is found, or a file can't be parsed, the run still uploads normally.

What gets merged

Enrichment adds these per-test fields:

FieldSourceWhat it carries
stepsAllure / JUnitOrdered test steps with status
attachmentsAllureFiles attached during the test (logs, screenshots, payloads)
severityAllureThe test's severity label (blocker, critical, normal, …)
artifactsAllureUploaded attachment references

Allure labels and richer failure detail are merged onto the test as well, so the cloud view matches what your Allure report showed.

Attachments are uploaded to TestRelic cloud storage and linked from the test, so you can open them from the Run / Test detail view.

Enabling and pointing at reports

By default the plugin auto-detects the Allure directory (from --alluredir) and a JUnit XML file. Use the flags below to set explicit paths or to turn enrichment off:

FlagEnv varPurpose
--testrelic-pytest-no-enrichTESTRELIC_NO_ENRICH=1Disable report enrichment
--testrelic-pytest-allure-dir <dir>TESTRELIC_ALLURE_DIRExplicit Allure results directory
--testrelic-pytest-junit-xml <file>TESTRELIC_JUNIT_XMLExplicit JUnit XML file
Terminal
# Generate Allure + JUnit output, then upload enriched results
pytest --alluredir=allure-results --junitxml=report.xml
Terminal
# Point at explicit paths
pytest \
--testrelic-pytest-allure-dir allure-results \
--testrelic-pytest-junit-xml report.xml
tip

Allure enrichment needs the optional reader. Install it with the extra:

Terminal
pip install "testrelic-pytest[allure]"

JUnit XML enrichment needs no extra.

note

Enrichment runs at session end, after your tests finish, so it never changes test outcomes — it only adds detail to what is uploaded.