Skip to content

Add BDD and E2E coverage for lockfile rebuild after bump (#92) - #130

Merged
leynos merged 2 commits into
mainfrom
issue-92-bdd-e2e-lockfile-rebuild
Jul 8, 2026
Merged

Add BDD and E2E coverage for lockfile rebuild after bump (#92)#130
leynos merged 2 commits into
mainfrom
issue-92-bdd-e2e-lockfile-rebuild

Conversation

@leynos

@leynos leynos commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #92

  • BDD: new cli.feature scenario configures bump.lockfile_manifests with a nested manifest (nested/Cargo.toml) and asserts the CLI output lists both the root and nested lockfiles with the (lockfile) suffix.
  • E2E: new e2e.feature scenario configures the non-trivial fixture workspace to rebuild the app crate lockfile, seeds stale Cargo.lock files, and backs the cargo::update stub with a runs() handler that rewrites the targeted lockfile the way cargo would. After lading bump runs via the real CLI process, the test asserts the output lists the regenerated lockfiles and that both files on disk carry the regenerated content — exercising the complete workflow through the CLI to the cargo boundary and resulting filesystem state.

Testing

  • make check-fmt, make lint, make typecheck, and make test (563 passed) all green after rebasing onto current main.
  • coderabbit review --agent: 0 findings.

References

🤖 Generated with Claude Code

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @leynos, you have reached your weekly rate limit of 2500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This pull request adds BDD and end-to-end test coverage for the nested lockfile rebuild behaviour of the lading bump command. New feature scenarios and step definitions verify that both root and nested Cargo.lock files are correctly regenerated and reported in CLI output.

Changes

Lockfile rebuild test coverage

Layer / File(s) Summary
BDD scenario and step for nested lockfile rebuild
tests/bdd/features/cli.feature, tests/bdd/steps/test_bump_steps.py
New scenario asserts lading bump output lists root and nested Cargo.lock paths; new given step configures bump.lockfile_manifests, writes the nested manifest and lockfile, and stubs cargo::update against it.
E2E scenario and steps for regenerated lockfiles
tests/e2e/features/e2e.feature, tests/e2e/steps/test_e2e_steps.py
New scenario bumps a workspace with a nested manifest; new steps configure lockfile_manifests, seed stale lockfile contents, stub cargo::update by manifest path, and assert both CLI output and on-disk lockfiles reflect regeneration.

Sequence Diagram(s)

sequenceDiagram
  participant Test as E2E test step
  participant CmdMox as cargo::update stub
  participant CLI as lading bump
  participant FS as Cargo.lock files

  Test->>FS: write stale content to root and crates/app Cargo.lock
  Test->>CmdMox: stub cargo::update by --manifest-path
  Test->>CLI: run lading bump 1.0.0
  CLI->>CmdMox: invoke cargo::update per manifest
  CmdMox->>FS: rewrite matching Cargo.lock
  Test->>CLI: assert stdout lists regenerated lockfiles
  Test->>FS: assert lockfile contents match marker
Loading

Possibly related PRs

  • leynos/lading#85: Introduces the lockfile_manifests/rebuild_lockfiles bump behaviour that these new tests exercise directly.

Suggested labels: Issue

Poem

A lockfile lost, a nested trail,
now bump commands leave nothing stale.
BDD hops, E2E runs,
two Cargo.locks, refreshed as one.
🐇✨ Tests confirm the rebuild's true! 🔒

🚥 Pre-merge checks | ✅ 20
✅ Passed checks (20 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy #92 by adding nested-manifest BDD coverage and an E2E bump flow that verifies regenerated Cargo.lock files.
Out of Scope Changes check ✅ Passed No out-of-scope changes are apparent; the edits are confined to the requested test coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Testing (Overall) ✅ Passed PASS: The new BDD and E2E scenarios drive the real CLI, stub cargo at the boundary, and assert both output and on-disk lockfile contents, so missing nested rebuilds would fail.
User-Facing Documentation ✅ Passed No user-facing code changed; docs/users-guide.md already covers lockfile_manifests and lockfile regeneration, and README signposts the guide.
Developer Documentation ✅ Passed Only BDD/E2E tests changed; no internal API, architecture, ADR, or execplan work was added, and lockfile behaviour is already documented in users-guide.
Module-Level Documentation ✅ Passed PASS: Both changed Python step modules start with module docstrings; no new Python module lacking module-level documentation was introduced.
Testing (Unit And Behavioural) ✅ Passed PASS: The new BDD and E2E scenarios invoke the real CLI boundary, stub only external cargo calls, and assert user-visible lockfile output plus on-disk regeneration.
Testing (Property / Proof) ✅ Passed Do not recommend property or proof tooling: this PR only adds example-based BDD/E2E coverage for a specific nested lockfile case, with no new range-based invariant or proof obligation.
Testing (Compile-Time / Ui) ✅ Passed No compile-time Rust/TS behaviour is added, and the new CLI/e2e checks use focused semantic assertions on lockfile output and file contents.
Unit Architecture ✅ Passed bump.run still delegates lockfile rebuilds through BumpOptions.command_runner into bump_lockfiles; the new BDD step uses structured TOML helpers and the E2E test exercises the real CLI seam.
Domain Architecture ✅ Passed PASS: The PR only adds BDD/E2E test coverage under tests/; no domain or production code changed.
Observability ✅ Passed Only test feature/step files changed; no production logging, metrics, tracing or alerts were altered.
Security And Privacy ✅ Passed Pass: inspect the PR; it adds only test fixtures and assertions, with no secrets, auth changes, or unsafe sinks.
Performance And Resource Use ✅ Passed New code is test-only and uses fixed-size loops plus bounded file reads/writes; no unbounded growth or hot-path regressions appear.
Concurrency And State ✅ Passed Only BDD/E2E tests changed; mutable state stays scenario-local in fixtures/e2e_state, with no new async, locking, or shared globals.
Architectural Complexity And Maintainability ✅ Passed PASS: The PR adds only small test-step helpers and feature scenarios; it introduces no new layers, traits, registries, or cross-module abstractions, and reuses existing TOML helpers.
Rust Compiler Lint Integrity ✅ Passed Diff touches only BDD/E2E Python and feature files; no Rust sources, lint suppressions, or clone changes were added.
Title check ✅ Passed The title matches the PR scope and includes the linked issue reference (#92).
Description check ✅ Passed The description directly covers the new BDD and E2E lockfile rebuild coverage and is on-topic.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-92-bdd-e2e-lockfile-rebuild

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

The lockfile rebuild path introduced with configurable lockfile
regeneration had no BDD scenario and no end-to-end assertion that
Cargo.lock files are actually rewritten after lading bump on a
workspace with nested manifests.

BDD: a new cli.feature scenario configures bump.lockfile_manifests
with a nested manifest and asserts the CLI output lists both the root
and nested lockfiles with the (lockfile) suffix.

E2E: a new e2e.feature scenario configures the non-trivial fixture
workspace to rebuild the app crate lockfile, seeds stale Cargo.lock
files, and backs the cargo::update stub with a handler that rewrites
the targeted lockfile the way cargo would. After lading bump runs via
the real CLI process, the test asserts the output lists the
regenerated lockfiles and that both files on disk carry the
regenerated content.

Closes #92
@leynos
leynos force-pushed the issue-92-bdd-e2e-lockfile-rebuild branch from 8f564fe to 6ba351a Compare July 7, 2026 21:52
codescene-access[bot]

This comment was marked as outdated.

@pandalump
pandalump marked this pull request as ready for review July 7, 2026 21:54
@coderabbitai coderabbitai Bot added the Issue label Jul 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/e2e/steps/test_e2e_steps.py`:
- Around line 311-317: The lading.toml fixture edit in the E2E step is using a
raw string replace, which ties the test to exact formatting. Update the
workspace config mutation in the step that reads and writes config_path to use
the same toml_utils helper flow already used in test_bump_steps, so the bump
section is modified structurally instead of by matching the literal "[bump]"
text. Keep the change localized to the existing step logic around workspace.root
and config_path, and preserve the lockfile_manifests insertion through the TOML
helper API.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6eec53cb-b563-44e8-ac13-c2e7012f8706

📥 Commits

Reviewing files that changed from the base of the PR and between 106e740 and 6ba351a.

📒 Files selected for processing (4)
  • tests/bdd/features/cli.feature
  • tests/bdd/steps/test_bump_steps.py
  • tests/e2e/features/e2e.feature
  • tests/e2e/steps/test_e2e_steps.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • leynos/cmd-mox (auto-detected)
  • leynos/shared-actions (auto-detected)

Comment thread tests/e2e/steps/test_e2e_steps.py Outdated
Refactor the `given_workspace_rebuilds_app_lockfile` E2E step to configure
`bump.lockfile_manifests` through the structural `toml_utils` helper flow
(`load_or_create_document`/`ensure_table`/`ensure_array_field`/
`append_if_absent`) already used in `test_bump_steps`, rather than a raw
`str.replace("[bump]\n", ...)`. The literal replacement coupled the test to
the exact formatting of the fixture config; the helper API edits the `[bump]`
table structurally and is robust to layout changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@leynos
leynos merged commit 3e8b547 into main Jul 8, 2026
6 checks passed
@leynos
leynos deleted the issue-92-bdd-e2e-lockfile-rebuild branch July 8, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add BDD and E2E test scenarios for lockfile rebuild after bump

1 participant