Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ef74422
feat(stdlib): add cross-platform 'which' filter and function to resol…
leynos Nov 18, 2025
680eca7
refactor(stdlib/which): split `which` filter into modular components
leynos Nov 18, 2025
a6ffaa1
refactor(testing,bdd): replace cucumber with rstest-bdd for behavior …
leynos Nov 18, 2025
e4f1ce2
refactor(which): update which tests to use ToolName, DirName, and Tem…
leynos Nov 20, 2025
1d6e9dc
refactor(stdlib/which): derive Default for CwdMode using attribute
leynos Nov 22, 2025
1e1a72d
test(stdlib): replace 'And' with 'Given' in stdlib.feature scenarios
leynos Nov 23, 2025
231b958
Wire cwd override for which; add workspace search and cucumber tests …
leynos Nov 24, 2025
591d6c4
feat(which): add LRU caching with env fingerprint for which resolution
leynos Nov 24, 2025
afae649
feat(which): support PATHEXT-aware executable resolution on Windows
leynos Nov 24, 2025
0418339
refactor(stdlib::which): simplify and modularize direct executable pa…
leynos Nov 24, 2025
c5d08ff
docs(resolver): add sequence diagram illustrating which resolver flow
leynos Nov 24, 2025
c43f37b
Update code
leynos Nov 24, 2025
7caf250
fix(stdlib): propagate errors from stdlib registration and which cach…
leynos Nov 24, 2025
b712bbd
feat(stdlib/which): enhance workspace command lookup with PATHEXT and…
leynos Nov 24, 2025
aed5a18
feat(stdlib): extract registration and config modules
leynos Nov 24, 2025
02897e8
feat(stdlib/config): update StdlibConfig builders to return Result
leynos Nov 24, 2025
799798f
refactor(which): use cfg attributes to adjust workspace_entry_matches…
leynos Nov 24, 2025
f1a343e
refactor(which/lookup): move workspace fallback search to a new module
leynos Nov 24, 2025
108c0a7
refactor(which): Refactor workspace search to improve readability and…
leynos Nov 24, 2025
68fd98e
feat(which): add workspace-based executable search with platform-spec…
leynos Nov 24, 2025
76d428e
feat(which/lookup): add cross-platform workspace search for commands
leynos Nov 24, 2025
ba24621
style(which): fix imports ordering under Windows cfg
leynos Nov 24, 2025
e02cbac
docs(which): add detailed docs to workspace executable search functions
leynos Nov 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 43 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ md5 = { package = "md-5", version = "0.10", optional = true }
itoa = "1"
itertools = "0.12"
indexmap = { version = "2.5", features = ["serde"] }
lru = "0.16"
glob = "0.3.3"
walkdir = "2.5"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["fmt"] }
serde_json = { version = "1", features = ["preserve_order"] }
Expand Down
2 changes: 1 addition & 1 deletion docs/adr-001-replace-serde-yml-with-serde-saphyr.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ it offers:

- **Safety:** A pure Rust implementation with **no `unsafe` libyaml
dependencies**([2](https://www.reddit.com/r/rust/comments/1bo5dle/we_lost_serdeyaml_whats_the_next_one/#:~:text=For%20the%20,key%20support%20and%20nested%20enums))([2](https://www.reddit.com/r/rust/comments/1bo5dle/we_lost_serdeyaml_whats_the_next_one/#:~:text=Those%20who%20dislike%20unsafe%20statements,it%20is%20also%20notably%20faster)),
eliminating C library risks.
eliminating C library risks.

- **Spec Compliance:** Full YAML 1.2 support (including proper handling of
anchors and merge
Expand Down
49 changes: 23 additions & 26 deletions docs/adr-002-replace-cucumber-with-rstest-bdd.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ The `rstest-bdd` project[^1][^2] exposes Given-When-Then macros that register
steps alongside `rstest` fixtures and generate scenario tests with the regular
test harness. Migrating unlocks a single runner (`cargo test`), reduces the
amount of bespoke world state, and lets behaviour tests reuse the same
fixtures, dependency-injection pattern, and lint configuration already in
place for unit tests.
fixtures, dependency-injection pattern, and lint configuration already in place
for unit tests.

## Decision outcome (summary)

Expand Down Expand Up @@ -72,8 +72,9 @@ place for unit tests.
### Phase 1 – Harness foundation

- Add `rstest-bdd = "0.1.0"` and `rstest-bdd-macros = { version = "0.1.0",
features = ["strict-compile-time-validation"] }` to the workspace
`dev-dependencies`. Keep `rstest` as the shared fixture provider.
features = ["strict-compile-time-validation"]
}` to the workspace `dev-dependencies`. Keep `rstest
` as the shared fixture provider.
- Introduce a `tests/bdd` module tree that will own scenario functions,
feature-specific fixtures, and utilities for inserting values into the
`StepContext`.
Expand All @@ -82,16 +83,16 @@ place for unit tests.
both the migration branch and future contributors have one source of truth.
- Decide on the default attributes applied to generated tests (for example,
stacking `#[scenario(...)]` with `#[tokio::test(flavor = "multi_thread")]`
for steps that require Tokio). Document the pattern in `docs/rstest-bdd-
users-guide.md`.
for steps that require Tokio). Document the pattern in
`docs/rstest-bdd-users-guide.md`.

### Phase 2 – Fixture extraction and world bridging

- Refactor `CliWorld` into plain data holders (for example `CliState`,
`ManifestState`, `StdlibState`, `ProcessState`) that expose the smallest
mutable surface required by each step. Each holder lives in `tests/bdd/
fixtures.rs` (or similar) and is backed by `Arc<Mutex<...>>` when interior
mutability is required.
mutable surface required by each step. Each holder lives in
`tests/bdd/fixtures.rs` (or similar) and is backed by `Arc<Mutex<...>>` when
interior mutability is required.
- Provide `#[rstest::fixture]` constructors for shared resources:
- Temporary workspace plus `PathGuard` handling for PATH edits.
- HTTP server guard that mirrors `start_http_server`/`shutdown_http_server`
Expand Down Expand Up @@ -161,9 +162,9 @@ the cucumber equivalents once the new tests pass.
- Remove `cucumber` (and `tokio` features added solely for the runner) from
`Cargo.toml` along with the `[[test]]` entry that disables the default
harness.
- Drop cucumber-specific documentation such as `docs/behavioural-testing-in-
rust-with-cucumber.md` once rewritten, and update any references in the user
guide and Orca/Ortho docs.
- Drop cucumber-specific documentation such as
`docs/behavioural-testing-in-rust-with-cucumber.md` once rewritten, and
update any references in the user guide and Orca/Ortho docs.

### Phase 5 – Documentation, CI, and enablement

Expand All @@ -181,7 +182,7 @@ the cucumber equivalents once the new tests pass.

## Consequences and risks

**Positive outcomes**
### Positive outcomes

- Behaviour tests run through the standard harness, so `make test` exercises
them alongside unit tests and inherits the existing CI parallelism.
Expand All @@ -191,25 +192,21 @@ the cucumber equivalents once the new tests pass.
(with `strict-compile-time-validation`), preventing silent drift between the
feature files and the Rust implementation.

**Risks and mitigations**
### Risks and mitigations

- *Risk:* Rewriting every step macro creates churn and may introduce subtle
regressions.
*Mitigation:* Port features in small slices, keep cucumber running until each
slice is validated, and rely on helpers shared between the old and new
harnesses to avoid behavioural drift.
regressions. *Mitigation:* Port features in small slices, keep cucumber
running until each slice is validated, and rely on helpers shared between the
old and new harnesses to avoid behavioural drift.
- *Risk:* The new fixture structs may not cover all the cleanup logic handled
implicitly by `CliWorld::drop`.
*Mitigation:* Model teardown as RAII helpers (`ScopeGuard`-style fixtures) and
add explicit tests that assert destructors restore environment variables,
stop HTTP servers, and delete temp files.
implicitly by `CliWorld::drop`. *Mitigation:* Model teardown as RAII helpers
(`ScopeGuard`-style fixtures) and add explicit tests that assert destructors
restore environment variables, stop HTTP servers, and delete temp files.
- *Risk:* Developers unfamiliar with `rstest-bdd` may struggle to add new
scenarios.
*Mitigation:* Expand the user guide with Netsuke-specific recipes and add a
`cargo bdd` section to the contributor docs.
scenarios. *Mitigation:* Expand the user guide with Netsuke-specific recipes
and add a `cargo bdd` section to the contributor docs.

## References

[^1]: <https://github.com/leynos/rstest-bdd/tree/v0.1.0>
[^2]: `docs/rstest-bdd-users-guide.md`

Loading
Loading