Examples and Sample Project
Point users to runnable examples that show the fastest path from install to observed effects.
Abstract
The showcase system is the safest place to learn Blackbox before adapting it to a real system. It demonstrates a subscription workflow that crosses HTTP, Postgres, Redis, a Stripe-like downstream API, an order service, SQS, and a fraud-check service.
Audience
New users, evaluators, and contributors who want a known-good project before wiring Blackbox into their own stack.
What The Sample Project Teaches
- How to run one useful system-test workflow.
- How a feature file, effect contract, runtime evidence, and OMC/DC report relate to each other.
- Which artifacts appear after a successful run.
- What a reviewer should inspect before trusting the result.
The Showcase Story
The canonical story is subscribe-flow: an existing user subscribes to the pro tier.
The test does more than assert an HTTP response. It verifies that the system:
- Reads the user tier from Redis.
- Reads user data from Postgres.
- Creates a payment intent through a Stripe-like HTTP boundary.
- Inserts the subscription into Postgres.
- Writes the new tier to Redis.
- Calls the order service.
- Sends a subscription message to SQS.
- Avoids forbidden effects such as refunds, deletes, truncates, and Redis flushes.
Source Files
| File | What it demonstrates |
|---|---|
e2e/tests/00-baseline-subscribe.system.test.ts | The baseline Playwright system test using Blackbox matchers and capture fixtures. |
e2e/features/subscribe-flow.feature | The readable feature artifact for the subscription workflow. |
e2e/tests/__effects__/00-baseline-subscribe.system.effects.yaml | Required and forbidden runtime effects for the same workflow. |
e2e/services/compose.user.yml | The production-shaped Docker Compose topology used by the testbed. |
e2e/.blackbox-coverage/ | Existing generated evidence and reports from a run. |
Run The Example
From the Blackbox repository root:
pnpm test:systemThat project script delegates to the e2e package, builds Blackbox, builds or selects the local OpenTelemetry bootstrap image, starts the testbed through Playwright, and writes coverage artifacts.
To regenerate reports from existing saved evidence:
pnpm exec blackbox coverage replay --coverage-dir e2e/.blackbox-coverage --out reportsWhat Makes A Good Sample
- It is runnable on the supported alpha stack.
- It produces real proof artifacts.
- It is small enough to inspect without a long setup.
- It matches the docs wording closely enough to serve as a sanity check.
Expected Artifacts
After a successful run, inspect:
.blackbox-coverage/omcdc-propagation.md.blackbox-coverage/omcdc-propagation.json.blackbox-coverage/omcdc.html.blackbox-coverage/coverage-final.json.blackbox-coverage/html/index.html.blackbox-coverage/spans/*.json.blackbox-coverage/v8-per-test/*.json
Start with the Markdown or HTML OMC/DC report. Use raw spans and V8 files only when debugging the evidence path.
What To Read Next
Figure Placeholder
Caption: The subscription-service showcase: test file, feature file, effects YAML, Docker Compose topology, and OMC/DC report.
Slot: <!-- TODO: insert interactive sample-project file map linked to the subscription flow -->