CI/CD Platforms
Set up automated test reporting in your CI/CD pipelines with TestKase.
Overview
Integrate TestKase reporting into your CI/CD pipeline to automatically push test results after every build.
Each platform guide provides a ready-to-use pipeline template with the @testkase/reporter CLI.
Supported Platforms
| Platform | Guide |
|---|---|
| GitHub Actions | GitHub Actions Guide |
| GitLab CI | GitLab CI Guide |
| Jenkins | Jenkins Guide |
| Azure DevOps | Azure DevOps Guide |
| CircleCI | CircleCI Guide |
Common Pattern
Every CI/CD integration follows the same three-step pattern:
- Store secrets — Add
TESTKASE_PATas a CI/CD secret or environment variable. Never hardcode tokens in pipeline files. - Run tests with continue-on-error — Your test step should not block the pipeline on failure. Use
continue-on-error: true(GitHub Actions),allow_failure: true(GitLab CI), or equivalent. - Run the reporter with always-execute — The reporting step must run regardless of test pass/fail. Use
if: always()(GitHub Actions),when: always(GitLab CI), orpost { always { } }(Jenkins).
Example Reporter Step
npx @testkase/reporter report \
--token $TESTKASE_PAT \
--project-id PRJ-1 \
--org-id 1173 \
--cycle-id TCYCLE-5 \
--format junit \
--results-file test-results/junit.xml \
--build-id "$BUILD_NUMBER"--cycle-id TCYCLE-5 above is a placeholder. The test cases you report on must already be linked to
the cycle you target. If they are not, the API rejects every result with Test case not linked with
this test cycle, the reporter exits 1, and this pipeline goes red on its first run. Either add those
test cases to the cycle first, or drop --cycle-id altogether and report into TCYCLE-1 — the Master
Cycle, which always contains every test case in the project.
Always include --build-id with your CI build number. This links each execution to a specific build, making it easy to trace results back to code changes.
Branching on the exit code
The reporter uses a different exit code per failure class, so a pipeline can distinguish a reporting problem from ordinary rejected results:
| Code | Meaning |
|---|---|
0 | Reported successfully |
1 | Some results were rejected by the API — usually test cases not linked to the target cycle |
2 | Authentication, network or API failure |
3 | Results file missing, or the wrong --format for the file |
4 | Untagged or unknown Automation IDs, with a fail policy set |
npx @testkase/reporter@1 report ... || code=$?
if [ "${code:-0}" -ge 2 ]; then
echo "TestKase reporting itself failed (exit $code)"
exit "$code"
fiFull detail in the Exit Codes reference.
A 0 does not prove results arrived. The reporter also exits 0 when the results file parsed but
contained no tests, when no Automation IDs matched the pattern, and when every attachment upload
failed. Read the Reported: N succeeded, N failed summary line in the job log on your first run.
Next Steps
- Choose your platform guide above and follow the step-by-step instructions.
- See Best Practices & FAQ for troubleshooting and optimization tips.
- See CLI Reference for the full list of reporter flags.
