@testream/pytest-reporter
v1.2.6
Published
Run pytest or ingest JUnit XML, then publish Python test results and CI metadata to Testream and Jira.
Maintainers
Readme
@testream/pytest-reporter: pytest test reporting for Jira
@testream/pytest-reporter runs pytest or ingests existing JUnit XML, then publishes Python test results to Testream as durable, Jira-visible evidence. It is suited to Python and Django projects that want CI reporting without recreating every automated test as a manual Jira case.
What the reporter sends to Testream and Jira
- pytest outcomes converted from JUnit XML to CTRF
- Failure messages, stack traces, duration, and suite structure
- Branch, commit, build, environment, and CI metadata, including merge-base data for pull-request comparisons
- Suite changes and trends for Jira work and release reviews
For pull requests, the reporter uses an explicit TESTREAM_MERGE_BASE_SHA or provider-supplied merge-base metadata; otherwise it resolves git merge-base from the existing checkout without fetching. Keep history available (fetch-depth: 0 on GitHub Actions); if no merge base can be resolved, Testream falls back to execution-time comparison.
Your pytest suite remains the execution source. Testream adds history, failure inspection, and Jira context around the results it produces.
Install and run in CI
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: pip install pytest
- run: npm install -g @testream/pytest-reporter
- run: |
testream-pytest \
--api-key "${{ secrets.TESTREAM_API_KEY }}" \
--fail-on-errorBy default, testream-pytest runs pytest and writes JUnit XML to junit/pytest-junit.xml. Use --junit-path when pytest already ran and you only need to ingest an existing JUnit XML report.
pytest evidence in CI/CD
Store TESTREAM_API_KEY as a protected secret. The same command can run in GitHub Actions, GitLab CI/CD, Azure Pipelines, Jenkins, or another command-based CI provider. Testream publishes the structured run so Python and Django test evidence can be reviewed with Jira and release context.
Frequently asked questions
Do we need to recreate automated tests as manual Jira cases?
No. pytest remains the code-first execution source. Testream publishes its results without requiring a duplicate manual case for every automated test.
Can we upload JUnit XML from an existing pytest job?
Yes. Pass --junit-path to ingest the report without running pytest again.
