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
| Flag | Type | Description |
|---|---|---|
--push <path> | path | Upload this directory as the test payload. Default: refuse if no git remote. |
--git-sha <sha> | string | Override the recorded commit SHA (auto-detected from git). |
--git-ref <ref> | string | Override the recorded ref (e.g., refs/heads/main). |
--pool <name> | string | Force routing to a specific pool. |
--ros <distro> | string | Override required ROS distro (humble, iron, rolling). |
--sim <engine> | string | Override sim engine (gazebo-harmonic, webots, etc.). |
--gpu | flag | Require a GPU runner. |
--watch / --no-watch | flag | Stream live logs to your terminal. Default: --watch on TTY. |
--wait / --no-wait | flag | Block until the run completes. Default: --wait. |
--timeout <duration> | duration | Maximum wall time (e.g., 30m). |
--label k=v | repeatable | Attach labels for filtering later. |
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.
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:
Dry-run (--no-confirm-charge)
--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:- Install
docker.io+curl(Ubuntu 22.04 base AMI). - Resolve the latest runner release from
https://get.roboticks.io/releases/latest. - Download the matching
roboticks-runner-linux-<arch>binary andchmod +x. - 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, thenshutdown -h now.
<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 pindocker_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).
ros:humble-ros-base or one of the osrf/ros:*-desktop-full tags.
rbtk test list
List recent test runs for the current project.
| Flag | Description |
|---|---|
--status passed|failed|running|queued | Filter by terminal or in-flight state |
--branch <ref> | Filter by git ref |
--since <duration> | Time window (e.g., 24h, 7d) |
--label k=v | Filter by attached labels |
--limit N | Max rows returned (default 20) |
Output
--output json, each row includes the run ID, pool, requirement coverage delta, and links.
rbtk test results
Structured results for one run.
--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>.
--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.
| Flag | Description |
|---|---|
--interval <seconds> | Polling interval (default 1, max 30). |
--output json | Emit one JSON object per status transition (stream-friendly). |
--timeout <duration> | Stop watching after this long (default: no timeout). |
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.
| Flag | Description |
|---|---|
--status passed|failed|skipped|error | Filter by outcome. |
--confirms <REQ-ID> | Only test cases that confirm this requirement (repeatable). |
--output json | Full structured rows including artifact_prefix (test-runs/{run_id}/test-cases/{slug}/). |
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.
| Flag | Description |
|---|---|
--nodeid <pytest-nodeid> | Scope to one test case. The CLI re-uses the deterministic sha256(nodeid)[:16] slug, so the local layout mirrors S3. |
--prefix <key-prefix> | Restrict to a sub-prefix inside the run or test case (e.g. mcap/, attachments/). |
--download | Download instead of listing. |
--out <dir> | Output directory (default .). Created if missing. |
--pattern <glob> | Only files matching glob (e.g., *.mcap). |
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.
| Flag | Description |
|---|---|
--out <dir> | Output directory (default .) |
--format pdf|reqif|zip|all | Pick a format. all extracts the bundle. |
--release <tag> | Get the pack for a specific release tag instead of a run ID |
--verify | Verify the hash chain after download |
Re-run a failed test
Next
Requirements
Upload, coverage, export.
Output formats
Sparkline tables, JSON, YAML, IDs-only.