Skip to content

test: adopt rstest across the workspace test suite - #3785

Open
markovejnovic wants to merge 1 commit into
mainfrom
chore/better-rstest
Open

test: adopt rstest across the workspace test suite#3785
markovejnovic wants to merge 1 commit into
mainfrom
chore/better-rstest

Conversation

@markovejnovic

Copy link
Copy Markdown
Contributor

No description provided.

@codspeed-hq

codspeed-hq Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 51 untouched benchmarks
⏩ 43 skipped benchmarks1


Comparing chore/better-rstest (10184bc) with main (a9d663c)

Open in CodSpeed

Footnotes

  1. 43 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@markovejnovic
markovejnovic marked this pull request as ready for review July 28, 2026 21:55
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Converts workspace tests to rstest parameterized cases and fixtures.

  • Adds rstest dev-dependencies where missing.
  • Consolidates equivalent test cases while preserving or expanding coverage.
  • Updates Cargo.lock for the new workspace dependency edges.

Confidence Score: 5/5

The PR appears safe to merge; no concrete regressions were identified.

The changes are confined to test organization and development dependencies, with existing scenarios and assertions preserved or strengthened.

Important Files Changed

Filename Overview
crates/atuin-ai/src/permissions/shell.rs Consolidates shell parsing and permission tests into equivalent parameterized cases.
crates/atuin-ai/src/tools/mod.rs Reworks tool tests around rstest fixtures and case tables without changing production behavior.
crates/atuin/src/command/client/search/interactive.rs Parameterizes interactive-search tests while retaining the previous scenarios and assertions.
crates/atuin-client/src/history.rs Converts serialization, privacy, and compatibility matrices to rstest with equivalent coverage.
crates/atuin-pty-proxy/src/osc133.rs Consolidates OSC 133 parser edge cases into parameterized tests without dropping cases.
Cargo.lock Records rstest dependency edges for crates newly declaring it as a development dependency.

Reviews (1): Last reviewed commit: "test: adopt rstest across the workspace ..." | Re-trigger Greptile

@markovejnovic
markovejnovic requested a review from ellie July 28, 2026 22:45
Comment on lines +667 to +672
#[case::from_v0(Version::Zero, BYTES_V0.to_vec(), expected_v0())]
#[case::from_v1(Version::One, BYTES_V1.to_vec(), expected_v1())]
#[case::from_v2(Version::Two, expected_v2().serialize().unwrap().0, expected_v2())]
fn deserialize_across_versions(
#[case] source: Version,
#[case] bytes: Vec<u8>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

doesn't really matter because it's a test but

Suggested change
#[case::from_v0(Version::Zero, BYTES_V0.to_vec(), expected_v0())]
#[case::from_v1(Version::One, BYTES_V1.to_vec(), expected_v1())]
#[case::from_v2(Version::Two, expected_v2().serialize().unwrap().0, expected_v2())]
fn deserialize_across_versions(
#[case] source: Version,
#[case] bytes: Vec<u8>,
#[case::from_v0(Version::Zero, BYTES_V0, expected_v0())]
#[case::from_v1(Version::One, BYTES_V1, expected_v1())]
#[case::from_v2(Version::Two, &expected_v2().serialize().unwrap(), expected_v2())]
fn deserialize_across_versions(
#[case] source: Version,
#[case] bytes: &[u8],

Refactor ~67 test files across 11 crates to use rstest idiomatically,
collapsing table-driven/duplicated tests into parametrized `#[case]` rows,
hoisting repeated setup into `#[fixture]`s (incl. async `#[future]`/`#[once]`),
and using `#[values]` matrices, `#[with]`/`#[default]` fixture overrides,
`#[cfg_attr]` per-platform cases, and `-> eyre::Result<()>` bodies.

- Add `rstest` dev-dep to atuin-kv, atuin-scripts, tests-database.
- Net ~1.5k fewer lines with no loss of coverage (parametrized cases run
  as independent tests).
- Vendored atuin-nucleo fork and standalone single-assertion tests left as-is.

Verified: full workspace test compile clean; 1582 tests pass, 0 fail
(the 3 Postgres-gated `tests/users.rs` integration tests still require a
live DB, unchanged); `cargo clippy --workspace --tests` clean.
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.

2 participants