Run gix-refspec tests with both sha1 and sha256#2448
Run gix-refspec tests with both sha1 and sha256#2448cruessler wants to merge 4 commits intoGitoxideLabs:mainfrom
gix-refspec tests with both sha1 and sha256#2448Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3dcb7ee9b7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| baseline "78b1c1be9421b33a49a7a8176d93eeeafa112da1:1111111111111111111111111111111111111111" | ||
| baseline "9d2fab1a0ba3585d0bc50922bfdd04ebb59361df:tags/special" | ||
| baseline "9d2fab1a0ba3585d0bc50922bfdd04ebb59361df:refs/tags/special" | ||
| case $GIX_TEST_FIXTURE_HASH in |
There was a problem hiding this comment.
Default fixture hash to sha1 when env var is unset
This script now unconditionally expands GIX_TEST_FIXTURE_HASH under set -u, so running the refspec tests without explicitly exporting that variable (for example via cargo nextest run -p gix-refspec) aborts fixture generation before any baseline is produced. Previously the tests worked with the default hash behavior, so this change introduces a regression unless every invocation path sets the env var; please make the script treat an unset value as sha1.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d58a35e673
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| cargo nextest run -p gix-protocol --features async-client --no-fail-fast | ||
| cargo nextest run -p gix-blame --no-fail-fast | ||
| env GIX_TEST_FIXTURE_HASH=sha1 cargo nextest run -p gix-refspec --no-fail-fast | ||
| env GIX_TEST_FIXTURE_HASH=sha256 cargo nextest run -p gix-refspec --no-fail-fast |
There was a problem hiding this comment.
Ignore sha256 match baseline archive output
Running this newly added sha256 test command causes gix-testtools to look for gix-refspec/tests/fixtures/generated-archives/match_baseline_sha256.tar; when it is missing, the fixture runner creates it, and generated-archives/.gitignore currently excludes only /match_baseline.tar. That means unit-tests now leaves a new untracked binary file behind on normal local runs, which is a regression for workflows that expect a clean worktree after tests.
Useful? React with 👍 / 👎.
GIX_TEST_FIXTURE_HASH for gix-refspecgix-refspec tests with both sha1 and sha256
This PR adds
sha256support togix-refspectests. It adds thesha256feature flag todev-dependenciesand runs the test suite forgix-refspecfor bothsha1andsha256. It adds separate branches for SHA-256 in a few places where SHA-1 hashes were hardcoded.Open questions
gix-refspec/tests/fixtures/generated-archives/.gitignoreincludes/match_baseline.tar. Does it also need to include/match_baseline_sha256.tar? (I haven’t committed the latter yet.)gix_refspec::parse::function::looks_like_object_hashusesgix_hash::Kind::shortest. Does it need to be changed? (I suspect it doesn’t.)This PR is related to #281.