Add rstest-bdd-harness-bevy as a workspace member (0.5.1.1) - #51
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Reviewer's GuideAdds a detailed execution plan document for roadmap task 0.5.1.1 to introduce a new Sequence diagram for planned headless Bevy BDD test flowsequenceDiagram
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)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
8a5f4ce to
0286437
Compare
0286437 to
554ed90
Compare
The Milestone 6 checklist is closed: the full gate sequence and the CodeRabbit review are green, the measurements are recorded, and the branch is ready for delivery through pull request #51.
Milestones 1-5 and the gate, measurement, and CodeRabbit parts of Milestone 6 are done; the branch push to update PR #51 awaits maintainer authorization for the force-with-lease push that the plan-mandated rebase makes necessary.
f3e66f2 to
cef22a7
Compare
|
Warning Your free Security trial is over. An organization admin can activate billing to continue. |
|
@coderabbitai please assess the implementation in this PR for completeness and correctness against the execplan:
|
This comment was marked as resolved.
This comment was marked as resolved.
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.
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.
Pull request #6 automerged, so the branch stack is rebased onto `main` and the merged root `rstest = "0.26"` requirement is reconciled into the crate manifest example. Note that the Bevy 0.19.1 probes are discharged by the Milestone 2/3 build itself, with evidence appended to the plan as it surfaces.
Add ADR 007 covering in-tree incubation of `rstest-bdd-harness-bevy`, the extraction contract, and the dependency decisions taken for roadmap task 0.5.1.1. Amend the harness design document: `rstest-bdd` 0.6.0-beta3 is published, so the crate uses published requirements rather than git dependencies against `main`. Record the later APIs unavailable under beta3, the Bevy standard-library feature requirement, and the crate layout names this task establishes. Update the roadmap to target Bevy 0.19.1 with implicit-caret stable requirements while the `rstest-bdd` family stays exactly pinned.
Add `crates/rstest-bdd-harness-bevy` to the workspace with a manifest pinned to Bevy 0.19.1 headless and the `rstest-bdd` family exactly at 0.6.0-beta3. `lib.rs` declares `mod profile;` but deliberately withholds the re-export, and `profile_tests.rs` imports the two functions that Milestone 3 will provide. The focused test run fails at compilation with the planned `E0432: unresolved imports` naming `add_minimal_plugins` and `minimal_app`; the whole-workspace `make typecheck` confirms the Bevy 0.19.1 graph checks cleanly under Cranelift, with the same grouped diagnostic as the only Rust error. The regenerated `Cargo.lock` resolves 121 normal and 267 dev-inclusive crates, and both headless-graph queries and the transitive extraction query pass.
Add `add_minimal_plugins` and `minimal_app` to `src/profile.rs`, each with a worked doctest, and re-export both from the crate root. `minimal_app` carries a message-bearing `#[must_use]` so the attribute survives `clippy::double_must_use` against Bevy's already-`#[must_use]` `App`. The focused run reports five unit tests and two doctests passing, confirming for `0.19.1` that `App::new()` omits `TimePlugin`, `MinimalPlugins` advances the frame counter, and the two entry points agree. `make check-fmt` and `make lint` (doc, Clippy, Whitaker) are green; the step-closure renames in the behavioural binding avoid `clippy::shadow_reuse`.
Bind the Gherkin scenario in `headless_scenario.feature` with the `include_str!` rebuild guard, prove the frame-count tick invariant over the bounded range with a 32-case property test, and tripwire the extraction contract with a manifest-text predicate and four tests. The A/B experiment confirms the guard is load-bearing: without it a feature-only edit passes stale, with it the same edit fails the scenario. The step closures are renamed from the plan's snippet because `clippy::shadow_reuse` denies closure parameters that shadow the step function's `app` binding.
Add the crate README with the Bevy compatibility table, orient the repository layout to the new member, add a developer's-guide section for the harness crate boundary and the four testing traps this task uncovered, and mark roadmap task 0.5.1.1 done. The documentation gates (mdformat, markdownlint, nixie, diff check) pass on the milestone tree.
Mark the documentation milestone done in the ExecPlan and add the selected 0.19.1 graph's resolved crate counts (121 normal, 267 with dev) beside the historical 0.17.3 figures.
All six commit gates pass on the completed milestone tree; the build-cost and build-tree measurements and the 0.5.1.2 inheritance list are recorded in Outcomes & retrospective.
The Milestone 6 checklist is closed: the full gate sequence and the CodeRabbit review are green, the measurements are recorded, and the branch is ready for delivery through pull request #51.
Milestones 1-5 and the gate, measurement, and CodeRabbit parts of Milestone 6 are done; the branch push to update PR #51 awaits maintainer authorization for the force-with-lease push that the plan-mandated rebase makes necessary.
Quote the "Plan: " prefix as prose instead of a code span, which tripped markdownlint MD038 (spaces inside code span elements).
The remote update is blocked on maintainer authorization: the force-with-lease push and the fast-forward-manufacturing merge are both refused by the auto-mode classifier, so the ExecPlan records the unblock paths and warns successors not to retry equivalent mechanisms.
Preserve `main`'s dependency updates while resolving the rebased Bevy `0.19.1` and `rstest-bdd` beta3 graph. Record the repeated local gates and acceptance evidence in the ExecPlan. Keep PR 51 pending until its merge state and remote CI are green.
cef22a7 to
6b185ee
Compare
|
@coderabbitai please assess the implementation in this PR for completeness and correctness against the execplan:
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
plan='docs/execplans/0-5-1-1-add-rstest-bdd-harness-bevy-workspace-member.md'
echo '=== PR state and checks ==='
gh pr view 51 --repo leynos/skyjoust \
--json number,baseRefName,headRefName,mergeStateStatus,mergeable,statusCheckRollup \
--jq '.'
echo '=== Changed files ==='
gh pr view 51 --repo leynos/skyjoust --json files \
--jq '.files[] | "\(.path)\t+\(.additions) -\(.deletions)"'
echo '=== ExecPlan headings and normative/verification terms ==='
rg -n -i \
'^(#{1,6} )|(^[[:space:]]*[-*] \[[ xX]\])|(\b(must|shall|required|acceptance|verification|validate|test plan|definition of done)\b)' \
"$plan"
echo '=== ExecPlan implementation and acceptance sections ==='
rg -n -i -C 3 \
'^(##|###) .*(implementation|detailed steps|validation|acceptance|test plan|verification|definition of done|quality)' \
"$plan" || true
echo '=== Changed source, manifests, tests, and feature files ==='
git diff --find-renames --name-only main...HEAD -- \
Cargo.toml Cargo.lock crates/rstest-bdd-harness-bevy docs \
| sort
echo '=== Rust outlines ==='
fd -e rs . crates/rstest-bdd-harness-bevy -x ast-grep outline {} --items all || true
echo '=== Relevant file contents ==='
for f in Cargo.toml \
crates/rstest-bdd-harness-bevy/Cargo.toml \
crates/rstest-bdd-harness-bevy/src/lib.rs \
crates/rstest-bdd-harness-bevy/src/profile.rs \
crates/rstest-bdd-harness-bevy/src/profile_tests.rs \
crates/rstest-bdd-harness-bevy/tests/headless_scenario.rs \
crates/rstest-bdd-harness-bevy/tests/tick_properties.rs \
crates/rstest-bdd-harness-bevy/tests/extraction_boundary.rs \
crates/rstest-bdd-harness-bevy/tests/features/headless_scenario.feature \
crates/rstest-bdd-harness-bevy/README.md \
docs/adr/007-in-tree-incubation-of-the-bevy-bdd-harness-crate.md \
docs/rstest-bdd-harness-bevy-design.md
do
if [ -f "$f" ]; then
echo "=== $f ==="
cat -n "$f"
fi
done
echo '=== Relevant diff ==='
git diff --find-renames main...HEAD -- \
Cargo.toml Cargo.lock crates/rstest-bdd-harness-bevy docs/adr \
docs/contents.md docs/developers-guide.md docs/repository-layout.md docs/roadmap.md \
docs/rstest-bdd-harness-bevy-design.mdLength of output: 17242 🏁 Script executed: #!/bin/bash
set -euo pipefail
plan='docs/execplans/0-5-1-1-add-rstest-bdd-harness-bevy-workspace-member.md'
echo '=== ExecPlan: constraints and implementation ==='
sed -n '82,132p;1057,1118p;1405,1528p;1727,2050p' "$plan"
echo '=== Current workspace and crate files ==='
for f in \
Cargo.toml \
crates/rstest-bdd-harness-bevy/Cargo.toml \
crates/rstest-bdd-harness-bevy/src/lib.rs \
crates/rstest-bdd-harness-bevy/src/profile.rs \
crates/rstest-bdd-harness-bevy/src/profile_tests.rs \
crates/rstest-bdd-harness-bevy/tests/headless_scenario.rs \
crates/rstest-bdd-harness-bevy/tests/tick_properties.rs \
crates/rstest-bdd-harness-bevy/tests/extraction_boundary.rs \
crates/rstest-bdd-harness-bevy/tests/features/headless_scenario.feature \
crates/rstest-bdd-harness-bevy/README.md \
docs/adr/002-crate-layout-and-public-api.md \
docs/adr/007-in-tree-incubation-of-the-bevy-bdd-harness-crate.md \
docs/contents.md \
docs/developers-guide.md \
docs/repository-layout.md \
docs/roadmap.md \
docs/rstest-bdd-harness-bevy-design.md
do
echo "=== $f ==="
cat -n "$f"
done
echo '=== Relevant lockfile packages ==='
rg -n -A 10 -B 2 \
'name = "(rstest-bdd-harness-bevy|bevy|rstest-bdd|rstest-bdd-harness|rstest-bdd-macros|skyjoust|lille)"' \
Cargo.lock
echo '=== PR file patches from GitHub ==='
gh api repos/leynos/skyjoust/pulls/51/files --paginate \
--jq '.[] | select(
.filename == "Cargo.toml" or
(.filename | startswith("crates/rstest-bdd-harness-bevy/")) or
(.filename | startswith("docs/"))
) | "=== \(.filename) ===\n\(.patch // "(patch unavailable)")"'
echo '=== Successful CI workflow and job steps ==='
gh api repos/leynos/skyjoust/actions/runs/32503642034 --jq \
'{name, event, head_sha, conclusion, status, workflow_id, path}'
gh api repos/leynos/skyjoust/actions/runs/32503642034/jobs --paginate --jq \
'.jobs[] | {name, conclusion, started_at, completed_at, steps: [.steps[] | {name, conclusion, number}]}'Length of output: 212711
Confirmed
Verification statusGitHub reports PR The CI Treat these checks as remaining non-independent evidence because this sandbox cannot execute repository code:
No static code or documentation defect blocks this PR. You are interacting with an AI system. |
Summary
Implements roadmap task
0.5.1.1: addscrates/rstest-bdd-harness-bevyas aworkspace member — a reusable, headless Bevy harness adapter for
rstest-bddbehavioural tests that stays free of Skyjoust and Lille code so it can move to
its own repository later.
What is delivered
0.19.1withdefault-features = falseand
features = ["std"], and therstest-bddfamily exactly pinned to=0.6.0-beta3.add_minimal_pluginsandminimal_app, withworked doctests; both stay public after
0.5.1.2builds the harness types.headless update tick, a 32-case frame-count property test, an
extraction-contract manifest tripwire, and an A/B-proven
include_str!rebuild guard.
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--agentpass completed with zerofindings.
The five maintainer decisions executed here
0.19.1for both the harness and the future runtime, written withimplicit caret syntax.
rstest-bddfamily exactly pinned to=0.6.0-beta3until a deliberatecompatibility pass validates a later release.
StepResultand propagateRefCellborrow failures;the scenario binding contains no
.expect().rstestat0.26, matchingthe merged root after PR Bump rstest from 0.18.2 to 0.26.1 #6).
mainonce PR Bump rstest from 0.18.2 to 0.26.1 #6 automerged; this branch carriesno second
rstestline.References
docs/execplans/0-5-1-1-add-rstest-bdd-harness-bevy-workspace-member.mddocs/adr/007-in-tree-incubation-of-the-bevy-bdd-harness-crate.mddocs/rstest-bdd-harness-bevy-design.md🤖 Generated with Claude Code
Summary by Sourcery
Add an independently extractable headless Bevy adapter for
rstest-bddbehavioural testing and establish its workspace, dependency, documentation, and verification foundations.New Features:
rstest-bdd-harness-bevycrate as a workspace member with public Bevy application profile helpers.Enhancements:
rstest-bdd0.6.0-beta3 dependencies.Build:
Documentation:
Tests: