Skip to content

Cleaner test output, clearer APIs, and publish-ready docs#11

Merged
dcrockwell merged 1 commit intodevelopfrom
feature/2.0-squashed
Dec 27, 2025
Merged

Cleaner test output, clearer APIs, and publish-ready docs#11
dcrockwell merged 1 commit intodevelopfrom
feature/2.0-squashed

Conversation

@dcrockwell
Copy link
Copy Markdown
Contributor

Why

Dream Test’s public surface had grown inconsistent across the runner, reporters, Gherkin, and matchers. Reporting also needed to stay readable under parallel execution while producing deterministic end-of-run output. Finally, the docs and examples needed to be “publish quality” and match reality.

What

  • A more consistent, pipe-friendly API across runner/reporters/Gherkin/matchers.
  • A reporting model that stays readable during the run and deterministic at the end:
    • live progress during execution
    • full, traversal-ordered results printed after the run
  • Optional colorized BDD output (bdd.color()), including more helpful, structured failure rendering.
  • Improved correctness in parallel execution (timeouts/crashes keep the original test identity; progress counts stay accurate even when hooks fail).
  • Gherkin cleanup and consistency (step registry is now steps.new(); examples improved for both inline DSL and .feature files).
  • Docs and examples refreshed and aligned with the new API; snippets are backed by real, runnable sources.
  • Added a failure showcase example project (intentionally failing) for visually validating reporter output without breaking make all.

How

  • Shifted reporting to an event-driven runner model: progress reacts to completion events during execution, while results reporters render from the final traversal-ordered result list.
  • Refactored built-in reporters into focused, end-of-run formatters with new() + pipe-friendly toggles.
  • Updated the executor to preserve test metadata for timeout/crash reporting and to emit progress events consistently.
  • Updated documentation + snippet-backed examples to match the new API and removed tracked .cursor/plans/* from git.

Notes

  • This is a breaking change (v2-style cleanup). Backwards compatibility was intentionally not preserved to keep the API and mental model clean.

## Why This Change Was Made
- The framework needed a consistent, pipe-friendly public API across runners, reporters, Gherkin, and matchers.
- Reporting needed a deterministic, parallel-safe model: live progress during execution, and traversal-ordered final results at the end.
- Docs/examples needed to be “publish quality” and aligned with the actual API (no stale snippets, no imaginary hooks).

## What Was Changed
- Runner/reporting architecture:
  - Introduced an event-driven runner model with a dedicated progress reporter during execution and results reporters rendered at end-of-run.
  - Added configurable output sinks (`runner.output(Output(out: ..., error: ...))`) and `runner.silent()`.
  - Ensured `RunFinished` carries traversal-ordered results for deterministic end reports.
- Reporters:
  - Refactored BDD + JSON into end-of-run results reporters with `new()` + pipe-friendly toggles.
  - Added `bdd.color()` and improved failure rendering using structured failure payloads (not string pattern matching).
  - Added/updated progress reporter to consume events safely and stay accurate under hook failures.
- Parallel execution correctness:
  - Fixed timeout/crash attribution to preserve original test metadata.
  - Fixed progress accounting when tests are synthesized (e.g. `before_all` failure cascades).
- Gherkin:
  - Standardized step registry creation to `steps.new()` (renamed from `new_registry`) and updated all references.
  - Improved Gherkin scenario formatting and examples (inline DSL + `.feature` files).
- Examples and docs:
  - Added `examples/failure_showcase` (intentionally failing demo project) and wired `make all` to run it without failing the whole build.
  - Updated all narrative docs, README, and snippet-backed examples to match the new v2 API and reporting model.
  - Added a “Custom reporters” section explaining current extensibility (output routing + post-run formatters).
- Repo hygiene:
  - Removed tracked `.cursor/plans/*` files from git (plans are ignored and should not be versioned).

## Note to Future Engineer
- The failure showcase is *supposed* to fail. If it ever turns green, either someone “fixed” the demo or reality has finally stopped producing bugs.
- If you change reporter extensibility, update the docs first—future-you deserves fewer archeological digs through commit history.
@dcrockwell dcrockwell merged commit a6fc3fd into develop Dec 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant