Skip to content

Add real-world lockfile fixtures for Go/Rust/Gradle parsers - #24

Merged
sns45 merged 1 commit into
mainfrom
22-real-lockfiles-dogfood
Apr 5, 2026
Merged

Add real-world lockfile fixtures for Go/Rust/Gradle parsers#24
sns45 merged 1 commit into
mainfrom
22-real-lockfiles-dogfood

Conversation

@sns45

@sns45 sns45 commented Apr 5, 2026

Copy link
Copy Markdown
Owner

Summary

Matches the existing testdata/lockfiles/*-real/ pattern (uv-real, poetry-real, pdm-real, requirements-txt-real) by vendoring lockfiles from popular open-source projects for the three new ecosystems. The discoverSnapshotCases harness picks these up automatically and runs them on every CI.

Fixture Source Components
gomod-real gohugoio/hugo go.mod + go.sum 184
cargo-real clap-rs/clap Cargo.lock 455
gradle-real Netflix/maestro maestro-aws/gradle.lockfile 83

These exercise the parsers against real-world shapes: long replace chains, /v2+ module paths, multi-version crates, git/registry source mixes, and sizeable Gradle configuration CSVs.

Refs #22.

Test plan

  • go test ./internal/sbom/ -run "TestSnapshots/(gomod|cargo|gradle)-real" -update generates snapshots
  • go test -race -count=1 ./...

Matches the existing testdata/lockfiles/*-real/ pattern already used for
Python (uv-real, poetry-real, pdm-real, requirements-txt-real). The new
fixtures are vendored from popular open-source projects and exercised
via the auto-discovered TestSnapshots harness on every CI run:

- gomod-real: gohugoio/hugo go.mod + go.sum (184 components)
- cargo-real: clap-rs/clap Cargo.lock (455 components)
- gradle-real: Netflix/maestro maestro-aws gradle.lockfile (83 components)

These snapshots catch parser regressions against real-world lockfile
shapes such as long replace directive chains, /v2+ module paths,
workspace members, git/registry source mixes, multi-version crates,
and large Gradle configuration CSVs.

Refs #22
@sns45
sns45 merged commit a8c4c73 into main Apr 5, 2026
1 check passed
@sns45
sns45 deleted the 22-real-lockfiles-dogfood branch April 5, 2026 15:01
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