Skip to main content

rbtk test

The test group is the busiest in the CLI. It triggers runs, lists historical runs, fetches structured results, streams logs, downloads artifacts, and pulls signed evidence packs.

rbtk test run

Kick off a test run. The most common invocation pushes the working directory to the platform, dispatches it to whichever pool matches the project’s routing rules, and waits for completion.

Flags

Examples

Exit code

0 if all tests passed. 7 if any test failed. Other non-zero codes indicate infrastructure errors.

rbtk test cloud

Convenience alias for rbtk test run --pool hosted-*. Picks the right hosted pool based on requirements.
Same flags as rbtk test run. The command always prints a workspace URL alongside the run ID so you (or a chat agent) can hand the link straight to a stakeholder:
The workspace URL is derived from the org slug and project slug — no extra round-trip.

Dry-run (--no-confirm-charge)

Returns a price quote without spending sim-minutes:
Add --confirm-charge to flip the same call into a real run.

What the cloud runner does on the EC2 host

For each cloud job, the platform pre-assigns a one-shot runner to the job and bakes its credentials into the EC2 user-data. The boot sequence is fixed and tight:
  1. Install docker.io + curl (Ubuntu 22.04 base AMI).
  2. Resolve the latest runner release from https://get.roboticks.io/releases/latest.
  3. Download the matching roboticks-runner-linux-<arch> binary and chmod +x.
  4. Run roboticks-runner run-job --job-token <token> --job-id <id> --api-endpoint <api> — the binary polls /internal/runners/poll, gets the assignment back, executes the test in Docker, posts status updates, then shutdown -h now.
The <token> is an ephemeral rbtk_lrnr_… runner_token that the platform issues alongside the assignment — not the per-job hex job_token (that field exists on TestJob for future use but isn’t the cloud-runner auth path today). Cloud runners auth the same way self-hosted runners do; the only difference is they have exactly one pre-assigned job waiting in self_hosted_runner_jobs when they call /poll.

Default docker image

If a test package doesn’t pin docker_image and the test request doesn’t override it, the platform falls back to python:3.12-slim so the contract is never null (the runner refuses to execute when docker_image, ros_distro, and sim_engine are all empty). The slim image does not include pytest — if your test_command is pytest -v, the run will exit 127 (“command not found”). Either:
  • Pin a real ROS2 / pytest-bearing image when you push the package (rbtk packages push ./ --docker-image ghcr.io/your-org/ros-test:humble), or
  • Make the test command install dependencies first (pip install pytest && pytest -v).
For the canonical ROS2 demos in roboticks-examples we pin ros:humble-ros-base or one of the osrf/ros:*-desktop-full tags.

rbtk test list

List recent test runs for the current project.

Output

With --output json, each row includes the run ID, pool, requirement coverage delta, and links.

rbtk test results

Structured results for one run.
Output (table):
With --output json, returns the full result graph: per-test outcomes, per-requirement links, MCAP attachments, coverage delta vs the previous run on the same branch.

rbtk test logs

Stream or fetch logs for a run. Equivalent to rbtk log <run-id>.
Logs include structured fields when --output json:

rbtk test watch

Live-stream a run’s status — queued → running → finished — without leaving the terminal. Polls the platform every second and exits when the run hits a terminal state.
Output (table):
Exit code matches rbtk test results once the run is terminal (0 for pass, 7 for fail, other non-zero for infra error).

rbtk test cases

List the test cases that executed inside a run, including their per-test-case S3 prefix. Useful for picking the --nodeid to feed back into rbtk test files.
Output (table):

rbtk test files

List or download per-test-case artifacts from a run — MCAP bags, screenshots, custom files emitted via attach_artifact(), JUnit XML, runner stdout/stderr.
On-disk layout mirrors S3 so artifacts stay grouped under the test that produced them:
rbtk test artifacts remains as a hidden alias for rbtk test files so existing scripts keep working.

rbtk test evidence-pack

Download the signed evidence pack for a run. Evidence packs are immutable, hash-chained PDF + ReqIF + ZIP bundles per release.
Verification:
See Evidence packs for the full chain-of-custody story.

Re-run a failed test

Next

Requirements

Upload, coverage, export.

Output formats

Sparkline tables, JSON, YAML, IDs-only.