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:
| Field | Source | What it carries |
|---|---|---|
steps | Allure / JUnit | Ordered test steps with status |
attachments | Allure | Files attached during the test (logs, screenshots, payloads) |
severity | Allure | The test's severity label (blocker, critical, normal, …) |
artifacts | Allure | Uploaded 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:
| Flag | Env var | Purpose |
|---|---|---|
--testrelic-pytest-no-enrich | TESTRELIC_NO_ENRICH=1 | Disable report enrichment |
--testrelic-pytest-allure-dir <dir> | TESTRELIC_ALLURE_DIR | Explicit Allure results directory |
--testrelic-pytest-junit-xml <file> | TESTRELIC_JUNIT_XML | Explicit JUnit XML file |
# Generate Allure + JUnit output, then upload enriched results
pytest --alluredir=allure-results --junitxml=report.xml
# Point at explicit paths
pytest \
--testrelic-pytest-allure-dir allure-results \
--testrelic-pytest-junit-xml report.xml
Allure enrichment needs the optional reader. Install it with the extra:
pip install "testrelic-pytest[allure]"
JUnit XML enrichment needs no extra.
Enrichment runs at session end, after your tests finish, so it never changes test outcomes — it only adds detail to what is uploaded.