# stormbreaker-core

> Ties a scenario to a run on the stormbreaker orchestrator.

Source: https://stormbreaker.nimbusxr.us/next/references/packs/stormbreaker-core/

Ties a scenario to a run on the stormbreaker orchestrator. A scenario tagged `@stormbreaker-group/<group>` opens a run for that group before its first step (`@stormbreaker-requires/<dispatcher>,...` names the dispatchers its readiness gate waits for). Traffic waits at the gate until the group's dispatchers have prepared for what the run declared. When the scenario passes, the run goes through cleanup, and the scenario passes only when every dispatcher cleaned up; when it fails, the run is abandoned and cleaned up all the same. The run's journal goes into the report.

Configure the orchestrator in axx.yaml: `packs: {stormbreaker-core: {url: ..., token: ...}}`.

## Add it

List it in the project's `axx-packs.yaml`, with the packs it builds on:

```yaml title="axx-packs.yaml"
packs:
  - github.com/nimbusxr/stormbreaker/packs/core@v0.1.0
```

## Settings

In `axx.yaml`, under `packs.stormbreaker-core`:

| Setting | What it is |
|---|---|
| `close` | How long a scenario waits for its run to close after cleanup opens (default 180s). |
| `fixtures` | The directory of the fixture factories and the streams, relative to axx.yaml (default: its directory; set it to fixtures.baseDir if axx.yaml sets one). |
| `lintLimit` | The most keys a stream may have for its identities to be checked for collisions when it binds (default 1000000). |
| `progress` | How often the run's progress (its steps, load and checks) goes to the orchestrator, for whoever watches it in the UI (default 1s; 0 sends only the last). |
| `readiness` | How long a scenario waits at its run's readiness gate (default 120s). |
| `token` | Its bearer token, if it asks for one; it can use ${env:...}. |
| `turn` | How long a scenario waits to open its run while another run holds the dispatchers its group needs (default 30m): runs never overlap on a dispatcher. |
| `url` (required) | The orchestrator's URL; it can use ${env:...}. |

## Hooks

The pack runs these around the scenarios and steps of every suite that lists it:

- `stormbreaker.run.open` (beforeScenario)
- `stormbreaker.run.gate` (beforeStep)

## Steps

### `stormbreaker.run.ready`

```gherkin
Given the run is ready
```

Wait at the run's readiness gate until every instance of every dispatcher it requires has prepared for everything the run declared. Traffic steps wait there anyway; this says so where a scenario wants to.

```gherkin
Given the run is ready
```

### `stormbreaker.run.traffic-complete`

```gherkin
When the run's traffic is complete
```

Close the run's window now: the run's traffic is done. Checks over the run, like Prometheus's, then judge the window it closed; without this step the window closes when the scenario ends.

```gherkin
When the run's traffic is complete
```
