bbrun and iconn

bbrun says what a script does. It does not connect to anything itself: it relies on iconn, another open source framework, to open the resources of an environment.

What iconn is

iconn builds the outside world an application runs in. You describe the services your code depends on, such as an HTTP API, a database, a mail server or a queue, and for each one whether it is real or stood in for. iconn starts the stand-ins, connects to the real ones, and gives your code one object for each, with the same operations either way.

iconn has its own uses without bbrun: testing an application against a declared set of dependencies, and running a local set of stand-ins to develop against. Its source and documentation are at iconn.dev.

What iconn does under bbrun

When a script starts, bbrun reads the resources of the chosen environment and hands them to iconn. iconn gives back one open resource for each name, and every call of the script goes through it.

In bbrun.yamlWhat iconn opens
a resource with a baseUrlits HTTP connector, to the real service, with the credentials of the resource
type: sql with an enginethe database server, through its engine's driver, from a pool of connections
type: sql without onean embedded database, with the tables and rows of data
type: queuea queue in memory
type: emaila mailbox that keeps what is sent
type: filea folder

Two kinds of resources are bbrun's own: the mock (type: mock), whose routes are bbrun expressions and scripts, and the services a program that embeds bbrun gives to its scripts. Everything else is iconn.

When the script ends, bbrun closes what iconn opened. Each run has its own.

One idea, two levels

Both frameworks hold the same idea: code names what it uses, and the environment decides what that is.

iconnbbrun
You writeapplication code, against a resourcea script, against a resource: fraudApi.post("/score", body)
The environment saysreal or stood in for, and how to reach itthe same, in bbrun.yaml
It gives youthe connectionthe logic on top of it: steps, checks, models, a result

So the two are used together or apart. A team can test its application with iconn alone and never write a script. A team that writes bbrun scripts gets iconn with it and never needs to call it.

What you need to do

Nothing: iconn is inside the bbrun command. You meet it only through what it makes possible, a resource that is a mock on your laptop and the real service in staging, under the same name.