How the seed is declared
The seed lives in the recipe, underapi.seed:
No secret ever enters the recipe. Only
provides does, so changing it changes which tests can be written.
The manifest
The run setsGUARD_SEED_OUT to a temporary file path. The seed command writes its results there as JSON:
seed-failed, naming what is missing. Extra keys are ignored with a warning. Fixture values keep their JSON type, so a number stays a number.
When it runs
The seed runs once per run, in the repository root. It runs afterapi.services.up has started the datastores, and before any server boots.
Using it in tests
{{cred:owner}}sends a seeded credential in a header value. Seeded credentials join the static ones fromapi.credentials.{{fixture:org.id}}inserts a fixture value. When a JSON value is exactly one placeholder, the native value is sent, so{"orgId": "{{fixture:org.id}}"}sends the number42.
«cred:<name>». Fixtures are ids and handles, not secrets, so they stay readable.
What survives
Each API test boots a fresh server. Seeded state survives only when it lives outside the server process, in a datastore thatapi.services.up starts, such as Postgres or Redis.
When a flow needs data the seed does not make
A flow that needs data the seed script does not create is Blocked, and says that it needs seed data. The app points you to Flow setup, which writes and proves the seed.Next steps
External services
Handle the third parties the program calls.
Flow generation
How tests are written against the seeded data.