The command line
bbrun runs a script, a folder of scripts or a load test, and
says what passed. Its exit status tells a pipeline the same.
Commands
| Command | Does |
|---|---|
bbrun init [folder] | writes a starter project that runs at once |
bbrun <script> | runs a script |
bbrun run <files and folders> | runs a suite and prints a summary |
bbrun load <script> | runs a script as a load test |
bbrun validate <script> | reads a script without running it, and reports its syntax errors |
bbrun envs | lists the environments, their resources and how each signs in |
bbrun models | lists the models of the domain document, with their fields |
bbrun libraries | lists what each of the project's libraries adds, fetching what is missing |
bbrun worker <address> --pool <pool> | runs the jobs of one srun pool on this machine: a worker |
bbrun --help, bbrun --version | the options; the version. bbrun <command> --help: one command's options |
Starting a project
bbrun init writes a project that runs with nothing else: a configuration, a
scenario and the mock the scenario calls. Give it a folder, which it makes when it is not
there, or none for the current folder:
$ bbrun init shop
wrote shop/bbrun.yaml
wrote shop/checkout.bbrun
wrote shop/mocks/shopApi.yaml
Run it: cd shop && bbrun checkout.bbrunIt never replaces a file: when one of the three is already there, it says which and writes nothing. The files are the ones that Get started goes through.
Running a script
bbrun checkout.bbrun # in the default environment
bbrun checkout.bbrun --env staging # in another environment
bbrun checkout.bbrun --verbose # showing each call and its answerThe configuration is bbrun.yaml (or .yml,
.json) in the current folder, else next to the script, else in a folder
above it. -c names another file.
| Option | Meaning |
|---|---|
-e, --env <name> | the environment to run in |
-c, --config <file> | the configuration file, when it is not found by itself |
-v, --verbose | also show each call and its answer |
-q, --quiet | show only what failed |
--json | print the result as JSON, for another program to read |
--log-dir <folder> | write one log file for each script there |
--no-color | no colours in the output |
Running a suite
bbrun run shop/ # every script of a folder
bbrun run a.bbrun b.bbrun other/ # several files and foldersA suite runs each script in the order of the names, each from a fresh start, then
prints one PASS or FAIL line for each and the totals. In a
folder, files and folders whose name starts with _ are left out: keep the
scripts you include there. So is a folder named mocks, whose
scripts answer a mock's routes.
$ bbrun run shop/ --quiet
Summary
PASS shop/01-checkout.bbrun 3/3 steps 10ms
PASS shop/02-invalid-input.bbrun 0ms
FAIL shop/03-not-found.bbrun 49ms
Assertion failed (line 4: response.status == 200); got 404; last response 404 {"code":"PRODUCT_NOT_FOUND"}
✖ 2 passed, 1 failed, 3 scriptsThe exit status is 0 when every script passed and 1 when one failed, so a pipeline stops on a failure.
In a pipeline
A pipeline needs the executable and the exit status. Download the release for the runner, run the suite against the environment of the pipeline, and let the step fail when a script does. This is a whole GitHub Actions workflow:
name: api-tests
on: [push]
jobs:
scenarios:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install bbrun
run: |
curl -sL https://github.com/STRIMS-AB/bbrun/releases/download/v1.2.0/bbrun-1.2.0-linux-x64.tar.gz | tar xz
sudo mv bbrun /usr/local/bin/
- name: Run the scenarios
run: bbrun run scenarios/ --env test
env:
SHOP_URL: https://staging.shop.example.com
SHOP_TOKEN: ${{ secrets.SHOP_TOKEN }}The credentials stay out of the scripts and out of the repository: the environment
names the variables (${SHOP_TOKEN}) and the pipeline provides them. Add
--json to print the result in a form the next step can read, and
bbrun load in a later step runs the same script as a load test.
The result as JSON
--json prints what the console shows, for another program:
{
"isSuccess": true,
"durationMs": 11,
"goals": ["A customer buys two travel mugs and finds the order afterwards"],
"passedAssertions": 6,
"failedAssertions": 0,
"requestCount": 3,
"steps": [
{ "name": "Look at the product", "passed": true, "durationMs": 2 },
{ "name": "Place the order", "passed": true, "durationMs": 2 },
{ "name": "Find it again", "passed": true, "durationMs": 1 }
],
"warnings": []
}The log
A run writes a log, line by line as things happen:
| Level | Line |
|---|---|
GOAL | a goal |
STEP | a step starts |
INFO | a print |
WARN | a warn that was false; a clean-up that failed after the script had failed |
CALL | a call and its answer: shopApi.post /orders → 201 (12 ms); on an open WebSocket, each message received or sent: queues websocket receive → {"type":"message",…} (3 ms) |
DONE | last, when the script passed: passed in 120 ms · 12 assertions · 5 requests |
ERROR | last, when it failed: the failure, with its step, line, value found and last response |
The console shows goals, steps, prints and warnings, and the calls with
--verbose. To keep the whole log, name a folder in the configuration
(logging: dir: logs) or on the command line (--log-dir logs,
which wins). bbrun then writes one file for each script, named after the time and the
script, and prints its path. Each line is written as it happens, so
tail -f follows a run.
2026-11-06 11:30:02.101 GOAL A customer buys two travel mugs and finds the order afterwards
2026-11-06 11:30:02.102 STEP Place the order
2026-11-06 11:30:02.114 CALL shopApi.post /orders → 201 (12 ms)Load tests
Any script is also a load test. bbrun load runs it again and again for a
number of users at the same time, shows the progress while it runs, then the success
rate, how long the runs took, and how long each call took on its own: a run's time mixes
all its calls, the calls say which one is slow. Calls count together by the path as the
script wrote it, /orders/${order.id}, not each order's own.
bbrun load checkout.bbrun --users 20 --iterations 500 --ramp-up 5s
bbrun load checkout.bbrun --users 10 --duration 30s --out before.json| Option | Meaning |
|---|---|
-u, --users <n> | users at the same time; 1 without it |
-i, --iterations <n> | runs of the script in all; the test stops when they are done |
-d, --duration <time> | how long to run: 30s, 5m, 1h, 1500ms |
-r, --ramp-up <time> | the time taken to reach all the users; without it they all start at once |
-o, --out <file> | also writes the result as JSON, to compare one run with another: the runs' times and each call's (n, failed, avg, p50, p90, p95, p99, max, in ms) |
-c, -e, -v, --no-color | as for a run |
Give --iterations, --duration or both: the test ends at the
first one reached. The summary is green from 99.5% of runs passed, yellow from 95% and
red below.
Looking at a project
$ bbrun envs
BBRun Configured Environments (2):
• dev
- paymentsApi (http) -> https://payments.dev.example.com/v1
auth: bearer
• local [DEFAULT]
- paymentsApi (mock)
$ bbrun validate checkout.bbrun
✔ Syntax valid: checkout.bbrunA worker
A scheduler on the internet cannot call a database that only answers inside your
network. bbrun worker turns that around. Started where your systems are, it
asks srun, the job scheduler of the Strims Backend Suite,
for the runs that are due, runs each job's script with the resources of this folder's
bbrun.yaml, and sends back the log and the result. Every call goes out, over
HTTPS; nothing listens.
$ bbrun worker https://srun.dev/acme/prd/api --pool dc1 --key-file worker.key
2026-12-02T16:35:26Z [dc1-worker-1] bbrun 1.2.0: runs of pool dc1 at https://srun.dev/acme/prd/api, 2 at a time
2026-12-02T16:35:26Z [dc1-worker-1] resources of /etc/bbrun/bbrun.yaml (production): ledger, stock
2026-12-02T16:35:26Z [dc1-worker-1] scripts read no files and no environment variables
2026-12-02T16:35:29Z [dc1-worker-1] run_3f71e6e29d47 of finance/balances: started
2026-12-02T16:35:29Z [dc1-worker-1] run_3f71e6e29d47 of finance/balances: succeeded (4 ms, 1 assertions passed)The address is srun's API address for the project's environment, which srun's dashboard
shows under API. The key is an API key of that project with the grant
JOBS_WORK. A job that names the pool, of kind bbrun, brings its
script; the run's payload is the script's request, what it prints is the
run's log, and what it returns the run's outputs:
ledger.get("/accounts/" + request.account)
assert response.status == 200
return { "account": request.account, "balance": response.body.balance }| Option | Default | |
|---|---|---|
--pool <pool> | the pool whose runs it takes; required | |
--zone <zone> | none | the project zone it runs in: it also takes the runs of jobs that name that zone |
--name <name> | the host name | this instance's name, as srun shows it |
--slots <n> | 2 | how many runs at a time, 1 to 64 |
--key-file <file> | BBRUN_WORKER_KEY | the file that holds the key, readable by its owner only; without it, the key is that environment variable. Never an argument |
-c, -e | bbrun.yaml here, its default environment | the configuration and the environment whose resources scripts reach |
--allow-files <folder> | no files | scripts read files in this folder and below |
--allow-env <NAME>,… | none | environment variables scripts read with env() |
--check | says what it would run with, and stops without calling srun |
The scripts come from srun, written by whoever may change the project's jobs. On a
worker they reach the resources of bbrun.yaml and nothing else of the
machine: no file, no environment variable, unless the two --allow options
open some, and never the key or bbrun.yaml itself. A run that is cancelled
in srun stops within about a second. When the worker is told to stop, it takes no more
runs and gives the running ones 30 seconds to finish.
The same worker answers API calls. In Kombi, the suite's API gateway, an operation is a bbrun script; an operation that names the worker's pool has its script run here instead of on Kombi. Your apps call Kombi on the internet, and the script reaches the systems of your network:
ledger.get("/accounts/" + request.params.account)
assert response.status == 200 : "No such account"
header("Cache-Control", "no-store")
return response.bodyThe caller waits for the answer: a call is taken at once by a worker that is asking for work, is never run twice, and answers 503 when no worker of the pool is there.