Skip to content

Add rstest-bdd-harness-bevy as a workspace member (0.5.1.1) - #51

Draft
leynos wants to merge 4 commits into
mainfrom
0-5-1-1-add-rstest-bdd-harness-bevy-workspace-member
Draft

Add rstest-bdd-harness-bevy as a workspace member (0.5.1.1)#51
leynos wants to merge 4 commits into
mainfrom
0-5-1-1-add-rstest-bdd-harness-bevy-workspace-member

Conversation

@leynos

@leynos leynos commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

Implements roadmap task 0.5.1.1: adds crates/rstest-bdd-harness-bevy as a
workspace member — a reusable, headless Bevy harness adapter for rstest-bdd
behavioural tests that stays free of Skyjoust and Lille code so it can move to
its own repository later.

What is delivered

  • A workspace crate pinned to Bevy 0.19.1 with default-features = false
    and features = ["std"], and the rstest-bdd family exactly pinned to
    =0.6.0-beta3.
  • Two public profile functions, add_minimal_plugins and minimal_app, with
    worked doctests; both stay public after 0.5.1.2 builds the harness types.
  • Behavioural, property, and boundary coverage: a Gherkin scenario driving one
    headless update tick, a 32-case frame-count property test, an
    extraction-contract manifest tripwire, and an A/B-proven include_str!
    rebuild guard.
  • ADR 007 recording the in-tree incubation, extraction contract, and
    dependency decisions; the design document, repository layout, developer's
    guide, roadmap, and contents index are aligned with it.

All six commit gates pass (check-fmt, check-state-graphs, markdownlint,
lint, test, nixie), and a CodeRabbit --agent pass completed with zero
findings.

The five maintainer decisions executed here

  1. Bevy 0.19.1 for both the harness and the future runtime, written with
    implicit caret syntax.
  2. rstest-bdd family exactly pinned to =0.6.0-beta3 until a deliberate
    compatibility pass validates a later release.
  3. Step functions return StepResult and propagate RefCell borrow failures;
    the scenario binding contains no .expect().
  4. Stable requirements use implicit caret syntax (rstest at 0.26, matching
    the merged root after PR Bump rstest from 0.18.2 to 0.26.1 #6).
  5. The stack was rebased onto main once PR Bump rstest from 0.18.2 to 0.26.1 #6 automerged; this branch carries
    no second rstest line.

References

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f5a8969e-b71a-470b-adb6-d3e6969b63c9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a detailed execution plan document for roadmap task 0.5.1.1 to introduce a new rstest-bdd-harness-bevy crate as a workspace member, clarifying decisions, constraints, risks, milestones, and validation steps without any code or configuration changes yet.

Sequence diagram for planned headless Bevy BDD test flow

sequenceDiagram
    actor Developer
    participant Cargo as cargo_test
    participant Rbdd as rstest_bdd
    participant Harness as HarnessAdapter
    participant App as bevy_app::App

    Developer->>Cargo: cargo test -p rstest-bdd-harness-bevy
    Cargo->>Rbdd: run minimal_app_advances_one_tick
    Rbdd->>Harness: run(ScenarioRunRequest)
    Harness->>App: minimal_app()
    Harness-->>Rbdd: Context(App)
    Rbdd->>App: App.update()
    Rbdd->>App: read FrameCount
    Rbdd-->>Cargo: scenario passed
    Cargo-->>Developer: tests ok (headless Bevy tick proved)
Loading

File-Level Changes

Change Details Files
Introduce a comprehensive ExecPlan document that defines how the rstest-bdd-harness-bevy Bevy BDD harness crate will be added and validated as a workspace member, including dependency and version decisions, risk management, milestones, and acceptance criteria.
  • Add a markdown ExecPlan describing the purpose and scope of the future Bevy harness crate and its headless-test goals.
  • Specify open decisions about Bevy version selection and rstest-bdd version pinning that must be approved before implementation.
  • Enumerate constraints, tolerances, risks, and progress milestones for implementing and validating the new crate and its tests.
  • Detail concrete gate commands, quality criteria, and behavioural acceptance steps for the future implementation.
  • Record a decision log and artefacts/evidence from probes validating assumptions about dependencies, lint traps, build cost, and harness contract feasibility.
docs/execplans/0-5-1-1-add-rstest-bdd-harness-bevy-workspace-member.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@leynos
leynos force-pushed the 0-5-1-1-add-rstest-bdd-harness-bevy-workspace-member branch from 8a5f4ce to 0286437 Compare August 15, 2026 21:54
@leynos
leynos changed the base branch from main to add-test-macro-for-fixture-lint-suppression August 15, 2026 21:55
Base automatically changed from add-test-macro-for-fixture-lint-suppression to main August 16, 2026 21:52
leynos and others added 3 commits August 16, 2026 22:52
Add `docs/execplans/0-5-1-1-add-rstest-bdd-harness-bevy-workspace-member.md`,
the approval-gated execution plan for roadmap task 0.5.1.1.

The plan is grounded in four executable probes run during planning rather
than in documentation alone:

- `rstest-bdd` 0.6.0-beta3 is published, so the roadmap's conditional
  instruction to use git dependencies against `main` no longer applies;
  the crate uses published caret requirements instead.
- `bevy = { version = "0.17.3", default-features = false }` compiles and
  ticks a headless `MinimalPlugins` application, resolving 98 crates
  against 428 for Bevy's defaults.
- The design's harness contract, including the reserved
  `rstest_bdd_harness_context` fixture key, works against published
  beta3.
- The planned crate shape passes `cargo clippy` and `cargo doc` under
  `-D warnings` on the pinned `nightly-2026-03-26`.

Three estate-specific traps surfaced and are recorded in the plan:
`allow-expect-in-tests` does not cover `rstest-bdd` step functions in
`tests/*.rs`; `googletest`'s `expect_that!` requires `#[gtest]`; and a
single-expression `#[fixture]` body trips `unused_braces`.

The plan is DRAFT and must be approved before implementation begins.
Revise the 0.5.1.1 execplan against a six-lens design review, with
each reviewer claim checked by executable probe rather than
accepted.

Corrected defects:

- Licence was `MIT OR Apache-2.0`, copied from the validator crate;
  the repository `LICENSE` and every published sibling are ISC. The
  crate is also marked unpublishable so the incubating copy cannot
  claim the upstream-documented name.
- The specified red state could not occur. Without the module
  declaration, rustc never compiles the sibling test file, so the
  run passed vacuously with zero tests.
- The two constructors could not become `BevyProfile::configure`
  bodies as claimed, because `configure` mutates a borrowed
  application. Reshaped to `add_minimal_plugins` plus a
  `minimal_app` wrapper, so the carry-forward is real.
- A caret on a pre-release is not a pin: it admits 0.6.0-beta4,
  which the plan itself documents as source-breaking.
- Omitting Bevy's standard-library feature substitutes a clock that
  reinterprets timestamp counter ticks as nanoseconds, which would
  have been a trap for the fixed-tick profile at 0.5.1.4.
- Feature unification is workspace-wide, so disabling default
  features bounds what the crate requests, not what a workspace
  build resolves.
- The `Outcomes & retrospective` section the document's own opening
  paragraph requires was missing.

Corrected figures: the graph is 139 crates, not 98; build cost is
now measured rather than asserted; coverage is met by the unit
tests, since the CI coverage action uses nextest, which does not
run doctests.

Two decisions the review could not settle from the repository are
raised for the approval gate: the Bevy version, and whether to
deviate from the caret mandate for pre-releases.
Withdraw the local `let`-binding workaround for the `rstest`
fixture expansion lint in favour of
`#[allow_fixture_expansion_lints]` from `skyjoust-test-macros`,
added by the layer beneath this one in the stack. The workaround
would have spread a bespoke idiom across every fixture the project
writes rather than fixing the cause once.

Renumber the harness ADR from 006 to 007; the lower layer takes 006
for the test-macro decision.

Restate the extraction contract to distinguish game code, which is
forbidden, from test-only tooling, which is not, and add
`skyjoust-test-macros` as a development dependency.

Make the boundary guard match dependency names exactly rather than
by substring, and anchor the `cargo tree` acceptance pattern on the
trailing space. Both changes exist because `skyjoust-test-macros`
contains the substring `skyjoust`, so the guard as previously
specified would have rejected a dependency the contract allows. A
fourth boundary test pins that behaviour; verified against a probe
where the unanchored pattern does match and the anchored one does
not.
@leynos
leynos force-pushed the 0-5-1-1-add-rstest-bdd-harness-bevy-workspace-member branch from 0286437 to 554ed90 Compare August 16, 2026 21:52
Target Bevy `0.19.1`, retain exact `rstest-bdd` beta pins, and
record implicit caret syntax for stable dependencies.

Require fallible BDD steps to propagate errors and make the PR #6
automerge and stack rebase prerequisites explicit. Add the missing
conformance and verification sections so the living plan records
traceability, external assumptions, and non-vacuity checks.
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