CLI Reporter
Upload CTRF test reports to Testream from any CI provider using the CLI.
What you need
- Testream API key (from testream.app → Settings → API Keys)
- A CTRF report that you want to upload. Check out https://ctrf.io/ for generating CTRF reports from your test runs.
GitHub Actions
Use the action for the easiest setup in GitHub Actions.
.github/workflows/tests.yml
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npx playwright test
- name: Upload to Testream
if: always()
uses: testream/upload-action@latest
with:
report-path: ctrf/ctrf-report.json
api-key: ${{ secrets.TESTREAM_API_KEY }}
Action inputs
| Input | Required | Default | Description |
|---|---|---|---|
report-path | Yes | - | Path to CTRF report JSON file |
api-key | Yes* | - | Testream API key (*required unless no-upload is true) |
test-tool | Yes | - | Test tool name (e.g., playwright, jest, cypress, dotnet) |
branch | No | auto | Git branch name |
commit-sha | No | auto | Git commit SHA |
repository-url | No | auto | Git repository URL |
build-name | No | auto | Build name/identifier |
build-number | No | auto | Build number |
build-url | No | auto | Build URL |
test-environment | No | - | Environment name (e.g., ci, staging) |
app-name | No | - | Application name |
app-version | No | - | Application version |
test-type | No | - | Test type (e.g., unit, e2e) |
no-upload | No | false | Skip upload (validate + summarize only) |
fail-on-error | No | true | Fail the action if upload fails |
CLI (Any CI provider)
Use the CLI in CircleCI, Bitbucket Pipelines, GitLab, Jenkins, Azure Pipelines, or local scripts.
npx @testream/upload-action \
--report-path ctrf/ctrf-report.json \
--test-tool playwright \
--api-key $TESTREAM_API_KEY
CLI options
| Option | Description |
|---|---|
-r, --report-path <path> | Required Path to CTRF report JSON file |
-k, --api-key <key> | Required API key for authentication |
--test-tool <name> | Required Test tool name (e.g., playwright, jest, cypress, dotnet) |
-b, --branch <name> | Git branch name |
-c, --commit-sha <sha> | Git commit SHA |
-u, --repository-url <url> | Git repository URL |
--build-name <name> | Build name/identifier |
--build-number <num> | Build number |
--build-url <url> | Build URL |
--test-environment <env> | Test environment (e.g., ci, staging) |
--app-name <name> | Application name |
--app-version <ver> | Application version |
--test-type <type> | Test type (e.g., unit, e2e) |
--no-upload | Skip uploading (validate + summarize only) |
--fail-on-error | Exit with non-zero code if upload fails |
CircleCI example
.circleci/config.yml
version: 2.1
jobs:
test:
docker:
- image: mcr.microsoft.com/playwright:latest
steps:
- checkout
- run: npm ci
- run: npx playwright test
- run:
name: Upload to Testream
command: |
npx @testream/upload-action \
--report-path ctrf/ctrf-report.json \
--test-tool playwright \
--api-key $TESTREAM_API_KEY \
--branch $CIRCLE_BRANCH \
--commit-sha $CIRCLE_SHA1 \
--repository-url $CIRCLE_REPOSITORY_URL \
--build-number $CIRCLE_BUILD_NUM \
--build-url $CIRCLE_BUILD_URL \
--test-environment ci
Bitbucket Pipelines example
bitbucket-pipelines.yml
image: mcr.microsoft.com/playwright:latest
pipelines:
default:
- step:
name: Tests
script:
- npm ci
- npx playwright test
- |
npx @testream/upload-action \
--report-path ctrf/ctrf-report.json \
--test-tool playwright \
--api-key $TESTREAM_API_KEY \
--branch $BITBUCKET_BRANCH \
--commit-sha $BITBUCKET_COMMIT \
--repository-url $BITBUCKET_GIT_HTTP_ORIGIN \
--build-number $BITBUCKET_BUILD_NUMBER \
--build-url "https://bitbucket.org/${BITBUCKET_REPO_FULL_NAME}/pipelines/results/${BITBUCKET_BUILD_NUMBER}" \
--test-environment ci
Other CI providers
Use the same CLI options in GitLab, Jenkins, Azure Pipelines, or any custom runner. If you already have a CTRF report, the CLI is all you need.
NPM package
- Package: @testream/upload-action
- Org: testream packages
What's Next?
- Learn about the Playwright Reporter
- Learn about the .NET Reporter
- Set up Jira Integration