Skip to content
Available onCommunityCloudPro

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

bash
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.tap

Branch, 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

bash
cdviz-collector send --run testsuiterun_tap \
  --url "$CDVIZ_URL" \
  -- node --test --test-reporter=tap --test-reporter-destination=TEST-results.tap

Node 21+ also ships a junit reporter — see JUnit Reports if you prefer XML.

Bash — bats

bash
cdviz-collector send --run testsuiterun_tap \
  --url "$CDVIZ_URL" \
  -- bash -c 'bats --formatter tap tests/ > TEST-results.tap'

Shell — shellspec

bash
cdviz-collector send --run testsuiterun_tap \
  --url "$CDVIZ_URL" \
  -- bash -c 'shellspec --format tap > TEST-results.tap'

Perl — prove

bash
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:

bash
cdviz-collector send --run testsuiterun_tap \
  --data testresults.tap \
  --url "$CDVIZ_URL" \
  -- pytest --tap-combined

pytest'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.