SHA-256 tests for gix-object#2528
Merged
Merged
Conversation
54f82c7 to
c16718e
Compare
32e71b2 to
69625dd
Compare
69625dd to
c148ed2
Compare
There was a problem hiding this comment.
Pull request overview
This PR expands gix-object’s test coverage to run against SHA-256 fixtures (via GIX_TEST_FIXTURE_HASH=sha256) in addition to the existing SHA-1 fixture runs, and updates tree-related tests to be hash-kind aware.
Changes:
- Run
gix-objectunit tests under both SHA-1 and SHA-256 fixture modes from thejustworkflow. - Add test helpers to rewrite SHA-1-authored tree fixtures into SHA-256-sized tree data on demand, and normalize tree render output for snapshot reuse.
- Convert tree editor assertions to
instainline snapshots and add a SHA-256make_treesgenerated fixture archive.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| justfile | Runs gix-object tests twice (SHA-1 and SHA-256 fixture modes), including verbose parsing error mode. |
| gix-object/tests/object/main.rs | Adds fixture_hash_kind(), tree_fixture(), fixture_oid(), generated_tree_root_id(), and normalize_tree_snapshot() helpers; broadens hash tests to Kind::all(). |
| gix-object/tests/object/tree/iter.rs | Switches to hash-kind aware fixtures and ODB initialization; uses computed root tree id for the fixture hash kind. |
| gix-object/tests/object/tree/from_bytes.rs | Uses rewritten tree fixtures and hash-kind aware assertions for tree decoding tests. |
| gix-object/tests/object/tree/editor.rs | Makes editor tests hash-kind aware and replaces string comparisons with insta snapshots (normalized across hash kinds). |
| gix-object/tests/object/encode.rs | Ensures tree round-trip tests use rewritten tree fixtures under SHA-256 runs; updates test error bounds. |
| gix-object/tests/fixtures/generated-archives/make_trees_sha256.tar | Adds SHA-256 fixture archive used when GIX_TEST_FIXTURE_HASH=sha256. |
| gix-object/Cargo.toml | Adds insta dev-dependency and enables gix-hash SHA-256 support for tests. |
| Cargo.lock | Records the new insta dependency for gix-object tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a follow-up to #2497, add SHA-256 tests to
gix-object, just because I liked whathappened in
gix-diff-tests, and it feels like it's time to have those tests forgix-objectas well.
Related to #2359
Tasks