Skip to content

Conformance CLI

Doug Fennell edited this page Oct 19, 2025 · 1 revision

RDCP Conformance CLI (Reference)

Complete reference for the @rdcp.dev/conformance CLI suite. These tools orchestrate discovery-driven test gating and produce CI-friendly artifacts (JUnit, badges).

Tools

  • rdcp-conformance β€” Discover /.well-known/rdcp and write run config for tag gating
  • rdcp-conformance-junit β€” Convert rdcp.results.json to JUnit XML
  • rdcp-conformance-badges β€” Generate Shields JSON and minimal SVG badges

Quick usage

npx rdcp-conformance --base-url=http://localhost:3000
npx rdcp-conformance-junit
npx rdcp-conformance-badges

rdcp-conformance (discovery + gating)

Discovers the target’s protocol capabilities and writes two files used by the test reporter and tag gating.

Outputs (default):

  • reports/rdcp.discovery.json β€” discovery snapshot { baseUrl, endpoints, security.level, security.methods, capabilities, ts }
  • reports/rdcp.run.json β€” run configuration { includeTags:[], excludeTags:[] }

Syntax

npx rdcp-conformance \
  --base-url=http://host:3000 \
  [--out=reports/rdcp.discovery.json] \
  [--include-tags=standard,bearer] \
  [--exclude-tags=jwks]

Options

  • --base-url URL (required unless RDCP_BASE_URL set)
  • --out PATH (default: reports/rdcp.discovery.json)
  • --include-tags CSV (optional) β€” restrict to tests that match at least one of these tags
  • --exclude-tags CSV (optional) β€” skip tests that match any of these tags

Environment variables (alternatives)

  • RDCP_BASE_URL β€” base URL
  • RDCP_DISCOVERY_FILE β€” discovery out path
  • RDCP_INCLUDE_TAGS, RDCP_EXCLUDE_TAGS β€” same semantics as flags

Exit codes

  • 0 success
  • 1 discovery failed (HTTP/parse/etc.)
  • 2 missing --base-url

Examples

# Minimal
npx rdcp-conformance --base-url=http://localhost:3000

# Only run Standard/Bearer-tagged tests (others skipped by gating)
npx rdcp-conformance --base-url=http://svc:3000 --include-tags=standard,bearer

# Exclude JWKS-tagged tests
npx rdcp-conformance --base-url=http://svc:3000 --exclude-tags=jwks

# Custom output location
npx rdcp-conformance --base-url=http://svc:3000 --out=.artifacts/rdcp.discovery.json

Note on execution vs gating

  • The test suite uses discovery + run.json to decide which tagged blocks execute (gating).
  • To run all tests locally, delete reports/rdcp.discovery.json (unknown env β†’ allow all tags) and ensure run.json is empty or absent; then npm test.
  • In CI (composite action), discovery runs by default; tags determine which tests execute and what gets counted.

rdcp-conformance-junit (reports β†’ JUnit)

Reads rdcp.results.json (emitted by the Jest reporter) and writes JUnit XML for CI.

Defaults

  • Input: reports/rdcp.results.json (env: RDCP_RESULTS)
  • Output: reports/rdcp.junit.xml (env: RDCP_JUNIT_OUT)

Usage

npx rdcp-conformance-junit
# or
RDCP_RESULTS=.artifacts/rdcp.results.json RDCP_JUNIT_OUT=.artifacts/rdcp.junit.xml \
  npx rdcp-conformance-junit

rdcp-conformance-badges (reports β†’ badges)

Generates Shields-compatible JSON and minimal SVG badges from rdcp.results.json.

Defaults

  • Input: reports/rdcp.results.json (env: RDCP_RESULTS)
  • Output directory: reports/badges (env: RDCP_BADGES_OUT)

Generated files

  • rdcp-summary.{json,svg} β€” overall passed/total
  • profile-{basic|standard|enterprise}.{json,svg}
  • cap-{control|jwks|keyring|jwt|admin|etag|util|otel|tenant|ttl|audit|rate-limit|client|integration|status|auth|headers|metrics|put|schema}.{json,svg}

Usage

npx rdcp-conformance-badges
RDCP_BADGES_OUT=public/badges npx rdcp-conformance-badges

Docker

A convenience Dockerfile is provided to run the suite with env-driven gating.

docker build -f Dockerfile.conformance -t rdcp-conformance .
# INCLUDE_TAGS / EXCLUDE_TAGS control gating; both optional
docker run --rm -e INCLUDE_TAGS=standard,bearer -p 3000:3000 rdcp-conformance

GitHub Actions (composite)

Use the composite action to run discovery β†’ tests β†’ JUnit β†’ badges and expose outputs.

- uses: ./.github/actions/rdcp-conformance
  with:
    base-url: http://service:3000
    include-tags: standard,bearer   # optional
    exclude-tags: jwks              # optional
  id: rdcp

# Gate on pass-rate
- if: ${{ steps.rdcp.outputs.pass-rate == '100' }}
  run: echo "Conformance OK β€” proceed to deploy"

# Artifacts uploaded by the action:
# - reports/rdcp.results.json
# - reports/rdcp.report.md
# - reports/rdcp.junit.xml
# - reports/badges/*

Running the full suite

  • Locally: ensure no discovery file exists (or delete reports/rdcp.discovery.json), then npm test runs all tagged tests.
  • In CI: skip/omit the discovery step (or remove the file before npm test) to execute the full suite regardless of target capabilities.

A future --allow-all flag may be added to bypass discovery gating explicitly.

Clone this wiki locally