diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-12 11:23:48 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-12 11:23:48 +0000 |
| commit | d07dc0e3b14b8464e47f5ab009552eacda568a36 (patch) | |
| tree | 7cfb4459127eac586e845122ed18449a4e8c70f5 | |
| parent | 0a1908bd6ee19f7079bb2914c0009bea1fc1db37 (diff) | |
fix: use consistent git identity for PR test commit hash
The PR_TEST_COMMIT_HASH constant was incorrect because the discovery test
used a different git identity (pr-test@example.com) than the actual
create_pr_test_commit function (test@grasp-audit.local from fixtures.rs).
This caused the same commit content to produce different hashes due to
different author/committer info being embedded in the commit object.
Fixed by updating the discovery test to use the same git identity as
clone_repo() in fixtures.rs, ensuring consistent commit hashes.
| -rw-r--r-- | grasp-audit/src/specs/grasp01/push_authorization.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/grasp-audit/src/specs/grasp01/push_authorization.rs b/grasp-audit/src/specs/grasp01/push_authorization.rs index c1003b9..677af89 100644 --- a/grasp-audit/src/specs/grasp01/push_authorization.rs +++ b/grasp-audit/src/specs/grasp01/push_authorization.rs | |||
| @@ -1701,16 +1701,16 @@ mod tests { | |||
| 1701 | String::from_utf8_lossy(&output.stderr) | 1701 | String::from_utf8_lossy(&output.stderr) |
| 1702 | ); | 1702 | ); |
| 1703 | 1703 | ||
| 1704 | // Configure git user - use PR Test Author identity | 1704 | // Configure git user - use same identity as clone_repo in fixtures.rs |
| 1705 | let output = Command::new("git") | 1705 | let output = Command::new("git") |
| 1706 | .args(["config", "user.email", "pr-test@example.com"]) | 1706 | .args(["config", "user.email", "test@grasp-audit.local"]) |
| 1707 | .current_dir(path) | 1707 | .current_dir(path) |
| 1708 | .output() | 1708 | .output() |
| 1709 | .expect("git config email failed"); | 1709 | .expect("git config email failed"); |
| 1710 | assert!(output.status.success(), "git config email failed"); | 1710 | assert!(output.status.success(), "git config email failed"); |
| 1711 | 1711 | ||
| 1712 | let output = Command::new("git") | 1712 | let output = Command::new("git") |
| 1713 | .args(["config", "user.name", "PR Test Author"]) | 1713 | .args(["config", "user.name", "GRASP Audit Test"]) |
| 1714 | .current_dir(path) | 1714 | .current_dir(path) |
| 1715 | .output() | 1715 | .output() |
| 1716 | .expect("git config name failed"); | 1716 | .expect("git config name failed"); |