TestRelic AI
Go to App
CLI

Upload existing reports

Import existing Allure or JUnit test reports into TestRelic Cloud with testrelic upload — a Cloud-only command that uses a tr_live_* ingest key.

testrelic upload imports test reports you already produce — Allure result directories, JUnit XML or CTRF JSON — into TestRelic Cloud, so historical and third-party runs land alongside runs from the SDK reporters. Performance runs from k6 and JMeter go through testrelic upload k6 and testrelic upload jmeter; see Performance testing.

Cloud-only, ingest key required

testrelic upload is Cloud-only and requires a tr_live_* ingest key — the same key the SDKs use to POST runs. A tr_mcp_* personal access token (used for the agent and MCP host) does not work here. Pass the key with --api-key or set TESTRELIC_API_KEY. If you're signed in with testrelic login as an org admin and no key is found, one is provisioned for you.

Usage

# Allure results directory
testrelic upload --format allure ./allure-results \
  --repo my-org/checkout \
  --branch main \
  --environment staging \
  --run-type regression \
  --api-key tr_live_xxxxxxxx

# JUnit XML
testrelic upload --format junit ./reports/junit.xml \
  --repo my-org/checkout \
  --run-type ci

Or provide the key via the environment:

export TESTRELIC_API_KEY=tr_live_xxxxxxxx
testrelic upload --format allure ./allure-results --repo my-org/checkout
Terminal~/checkout

$ testrelic upload --format allure ./allure-results --repo my-org/checkout --branch main --environment staging --run-type regression

Upload report './allure-results' to https://platform.testrelic.ai? [y/N] y

Parsing allure report from ./allure-results

Parsed 1 run(s), 128 test(s) · e2e tests

✓ authenticated — sam@acme.dev @ Acme

✓ repo: checkout (repo_7f3a2b)

Uploading 42 artifact(s)…

✓ uploaded run allure-1754322189 (128 tests)

Imported allure report: 1 run(s) uploaded · 128 test(s), 42 artifact(s) · e2e workspace.

View: https://platform.testrelic.ai/repos/repo_7f3a2b

Approving an upload

Nothing leaves your machine until the upload is approved. In a terminal, the CLI asks you to confirm. In CI, in print mode (-p), or whenever its input or output is piped, it refuses and sends nothing unless you configure an approver or skip approval explicitly:

# skip approval in trusted CI
TESTRELIC_APPROVE_UPLOAD=1 testrelic upload ./reports/junit.xml --repo my-org/checkout
# or: --yes is a global flag, so it goes BEFORE `upload`
testrelic --yes upload ./reports/junit.xml --repo my-org/checkout

# or require an approver: the command gets the upload descriptor as JSON on stdin
# and must print {"approved":true}
testrelic upload ./reports/junit.xml --approver "cmd:./approve-upload.sh"

TESTRELIC_UPLOAD_APPROVER sets the approver from the environment. --dry-run never asks, because it sends nothing.

Uploading again

The run id comes from the report's contents, so uploading the same report again folds into the same run, and its screenshots, videos and traces aren't sent a second time: the platform doesn't de-duplicate artifacts, so they would appear twice. Pass --reupload-artifacts only when a first upload's artifact step partly failed: it resends all of them. From CLI 1.8.4, when the CLI retries an upload by itself after a server error, the run's artifacts are still sent.

Flags

FlagPurpose
--format allure|junit|ctrfForce the report format instead of detecting it: an Allure results directory, a JUnit XML file or a CTRF JSON report.
--repoRepository the runs belong to.
--repo-git-idNormalized git remote id, to bind the upload to the same repo as live runs.
--branchBranch the runs are for.
--commitCommit the runs are for.
--environmentEnvironment the runs executed in (e.g. staging).
--run-type smoke|regression|nightly|ciClassifies the run.
--test-type e2e|api|mobile|unitSets the run's test type, so it lands in the matching workspace. Pass api for an API report. Without it, the type is detected from suite names and tags, and the cloud otherwise puts the run in the Web workspace.
--api-keytr_live_* ingest key (or set TESTRELIC_API_KEY).
--approver "cmd:<command>"Approver for non-interactive uploads (or set TESTRELIC_UPLOAD_APPROVER). See Approving an upload.
--no-artifactsSkip uploading attached artifacts (screenshots, videos, traces).
--reupload-artifactsSend artifacts again even when the run already exists in the cloud.
--dry-runParse and validate the report and show what would be sent, without uploading.

Validate first

Run with --dry-run to confirm the report parses and the metadata is right before sending anything to the cloud.

Next steps

→ Authentication · Modes & engines

Was this page helpful?

On this page