Skip to content

SHA-256 tests for gix-object#2528

Merged
Sebastian Thiel (Byron) merged 1 commit into
mainfrom
pass-hash-len-to-tree-ref-iter
Apr 20, 2026
Merged

SHA-256 tests for gix-object#2528
Sebastian Thiel (Byron) merged 1 commit into
mainfrom
pass-hash-len-to-tree-ref-iter

Conversation

@Byron
Copy link
Copy Markdown
Member

@Byron Sebastian Thiel (Byron) commented Apr 20, 2026

As a follow-up to #2497, add SHA-256 tests to gix-object, just because I liked what
happened in gix-diff-tests, and it feels like it's time to have those tests for gix-object
as well.

Related to #2359

Tasks

  • refackiew

@Byron Sebastian Thiel (Byron) force-pushed the pass-hash-len-to-tree-ref-iter branch from 54f82c7 to c16718e Compare April 20, 2026 08:01
@Byron Sebastian Thiel (Byron) marked this pull request as ready for review April 20, 2026 08:02
@Byron Sebastian Thiel (Byron) force-pushed the pass-hash-len-to-tree-ref-iter branch 2 times, most recently from 32e71b2 to 69625dd Compare April 20, 2026 08:16
@Byron Sebastian Thiel (Byron) force-pushed the pass-hash-len-to-tree-ref-iter branch from 69625dd to c148ed2 Compare April 20, 2026 08:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-object unit tests under both SHA-1 and SHA-256 fixture modes from the just workflow.
  • 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 insta inline snapshots and add a SHA-256 make_trees generated 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.

Comment thread gix-object/tests/object/tree/editor.rs
Comment thread gix-object/tests/object/tree/from_bytes.rs
@Byron Sebastian Thiel (Byron) merged commit 465b366 into main Apr 20, 2026
56 of 58 checks passed
@Byron Sebastian Thiel (Byron) deleted the pass-hash-len-to-tree-ref-iter branch April 20, 2026 13:25
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