Skip to content

test(lockfile): add property roundtrip coverage#376

Merged
jdx merged 1 commit intomainfrom
codex/lockfile-proptest-roundtrip
Apr 29, 2026
Merged

test(lockfile): add property roundtrip coverage#376
jdx merged 1 commit intomainfrom
codex/lockfile-proptest-roundtrip

Conversation

@jdx
Copy link
Copy Markdown
Contributor

@jdx jdx commented Apr 29, 2026

Summary

Adds property-based lockfile roundtrip coverage for generated registry-only graphs across pnpm, npm, Bun, Yarn classic, and Yarn Berry lockfile writers/parsers. The tests normalize dependency edges before comparing so they focus on structural graph preservation across each format.

Validation

  • cargo fmt --check
  • cargo test -p aube-lockfile --test proptest
  • cargo test -p aube-lockfile
  • cargo clippy -p aube-lockfile --all-targets -- -D warnings

This PR was generated by Codex.


Note

Low Risk
Test-only changes plus a new dev-dependency; no production code paths are modified.

Overview
Adds property-based roundtrip tests in aube-lockfile that generate small registry-only dependency graphs, write them as each supported lockfile format (pnpm/npm/bun/yarn classic/yarn berry), re-parse them, and compare a normalized representation to ensure structural preservation.

Introduces proptest as a dev-dependency (and updates Cargo.lock) to support this new randomized/parametric test coverage.

Reviewed by Cursor Bugbot for commit 499374f. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

Adds proptest-based roundtrip tests covering all five supported lockfile formats (pnpm, npm, Bun, Yarn classic, Yarn Berry). The strategy uses a correct triangular edge encoding (idx*(idx-1)/2 + prior_idx) that maps all reachable edges into a compact bit range, and the default proptest case count (256) is used — both improvements over what prior review comments suggested. Only dev-dependencies are touched; no production logic is changed.

Confidence Score: 5/5

Safe to merge — changes are limited to new test coverage and dev-dependency additions with no production logic modifications.

No P0 or P1 issues found. The single P2 observation (declared_dependencies not verified in normalization) is a test coverage gap, not a correctness defect. Cargo.lock additions are all reputable crates.io packages used only for testing.

No files require special attention.

Important Files Changed

Filename Overview
crates/aube-lockfile/tests/proptest.rs New proptest roundtrip suite for all five lockfile formats; uses correct triangular edge encoding; minor gap: declared_dependencies is populated but not verified in normalize()
crates/aube-lockfile/Cargo.toml Adds proptest = "1" to dev-dependencies only; no production dependency changes
Cargo.lock Lock file additions for proptest transitive deps (bit-set, bit-vec, rand_xorshift, rusty-fork, quick-error, unarray) — all from crates.io registry, dev-only

Fix All in Claude Code

Reviews (2): Last reviewed commit: "test(lockfile): add property roundtrip c..." | Re-trigger Greptile

Comment thread crates/aube-lockfile/tests/proptest.rs
Comment thread crates/aube-lockfile/tests/proptest.rs
@jdx jdx force-pushed the codex/lockfile-proptest-roundtrip branch from 962bd46 to 499374f Compare April 29, 2026 13:51
@jdx jdx merged commit f9c6c74 into main Apr 29, 2026
17 checks passed
@jdx jdx deleted the codex/lockfile-proptest-roundtrip branch April 29, 2026 14:18
@greptile-apps greptile-apps Bot mentioned this pull request Apr 29, 2026
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.

1 participant