test: adopt rstest across the workspace test suite - #3785
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Greptile SummaryConverts workspace tests to rstest parameterized cases and fixtures.
Confidence Score: 5/5The 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
Reviews (1): Last reviewed commit: "test: adopt rstest across the workspace ..." | Re-trigger Greptile |
| #[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>, |
There was a problem hiding this comment.
doesn't really matter because it's a test but
| #[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.
8d7e8fb to
10184bc
Compare
No description provided.