TAP Reports Integration
TAP (Test Anything Protocol) is the native output format of Node.js's built-in test runner, bats, shellspec, Perl's prove, and many smaller runners. cdviz-collector send --run testsuiterun_tap wraps your test command, collects the TAP report after the process exits, and emits testSuiteRun.started / testSuiteRun.finished CDEvents.
Setup
cdviz-collector send --run testsuiterun_tap \
--metadata "tested_artifact_id=pkg:npm/my-package@$NPM_VERSION" \
--url "$CDVIZ_URL" \
--header "Authorization: Bearer $CDVIZ_TOKEN" \
-- node --test --test-reporter=tap --test-reporter-destination=TEST-results.tapBranch, commit, and job name are auto-detected from CI environment variables — see CI auto-detection. Use --metadata tested_artifact_id=… to link results to the artifact under test.
IMPORTANT
The collector does not capture the test command's stdout — it reads report files after the process exits. Most TAP producers print to stdout, so redirect (> TEST-results.tap) or use the runner's file-output flag. The built-in glob is **/*.tap; pass --data <path-or-glob> for another location.
NOTE
testsuiterun_tap requires the parser_tap feature flag. Verify with cdviz-collector --version.
Examples by Ecosystem
Node.js — built-in test runner
cdviz-collector send --run testsuiterun_tap \
--url "$CDVIZ_URL" \
-- node --test --test-reporter=tap --test-reporter-destination=TEST-results.tapNode 21+ also ships a junit reporter — see JUnit Reports if you prefer XML.
Bash — bats
cdviz-collector send --run testsuiterun_tap \
--url "$CDVIZ_URL" \
-- bash -c 'bats --formatter tap tests/ > TEST-results.tap'Shell — shellspec
cdviz-collector send --run testsuiterun_tap \
--url "$CDVIZ_URL" \
-- bash -c 'shellspec --format tap > TEST-results.tap'Perl — prove
cdviz-collector send --run testsuiterun_tap \
--url "$CDVIZ_URL" \
-- bash -c 'prove --verbose t/ > TEST-results.tap'Python — pytest
pytest can emit TAP with the pytest-tap plugin:
cdviz-collector send --run testsuiterun_tap \
--data testresults.tap \
--url "$CDVIZ_URL" \
-- pytest --tap-combinedpytest's built-in --junit-xml needs no plugin and reports more detail — see JUnit Reports.
Reported Summary
The testSuiteRun.finished event carries customData.testsuiterun.summary with results_count, passed, failed, and exit_code. # SKIP / # TODO directives are parsed but not broken out as a skipped count (JUnit XML reports skipped, errors, and duration) — use JUnit output if that breakdown matters.
Related
- JUnit Reports — same pattern for XML test reports
- SARIF — same pattern for linters and scanners
- CI pipelines: GitHub Actions CI, GitLab CI, Jenkins
- Full flag list:
send --runreference