diff options
Diffstat (limited to 'grasp-audit')
| -rw-r--r-- | grasp-audit/src/fixtures.rs | 10 | ||||
| -rw-r--r-- | grasp-audit/src/specs/grasp01/push_authorization.rs | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/grasp-audit/src/fixtures.rs b/grasp-audit/src/fixtures.rs index fc6e8cb..45d3094 100644 --- a/grasp-audit/src/fixtures.rs +++ b/grasp-audit/src/fixtures.rs | |||
| @@ -1579,10 +1579,14 @@ impl<'a> TestContext<'a> { | |||
| 1579 | let _ = fs::remove_dir_all(path); | 1579 | let _ = fs::remove_dir_all(path); |
| 1580 | }; | 1580 | }; |
| 1581 | 1581 | ||
| 1582 | // Create a WRONG commit (Owner variant, not PRTestCommit) | 1582 | // Create a WRONG commit using a unique file (not PRTestCommit) |
| 1583 | // This commit hash will NOT match what's in the PR event's `c` tag | 1583 | // We use create_commit (non-deterministic) so it always succeeds even if the |
| 1584 | // repo already has a commit (e.g. from OwnerStateDataPushed) with the same | ||
| 1585 | // deterministic content. The only requirement is that the hash differs from | ||
| 1586 | // PR_TEST_COMMIT_HASH, which is guaranteed since PR_TEST_COMMIT_HASH is a | ||
| 1587 | // deterministic root-commit with specific content and dates. | ||
| 1584 | let wrong_commit_hash = | 1588 | let wrong_commit_hash = |
| 1585 | match create_deterministic_commit_with_variant(&clone_path, CommitVariant::Owner) { | 1589 | match create_commit(&clone_path, "wrong commit - not the PR test commit") { |
| 1586 | Ok(h) => h, | 1590 | Ok(h) => h, |
| 1587 | Err(e) => { | 1591 | Err(e) => { |
| 1588 | cleanup(&clone_path); | 1592 | cleanup(&clone_path); |
diff --git a/grasp-audit/src/specs/grasp01/push_authorization.rs b/grasp-audit/src/specs/grasp01/push_authorization.rs index 768e8f9..73cbe1f 100644 --- a/grasp-audit/src/specs/grasp01/push_authorization.rs +++ b/grasp-audit/src/specs/grasp01/push_authorization.rs | |||
| @@ -1231,9 +1231,9 @@ impl PushAuthorizationTests { | |||
| 1231 | } | 1231 | } |
| 1232 | }; | 1232 | }; |
| 1233 | 1233 | ||
| 1234 | // Create a wrong commit (Owner variant, not PRTestCommit) | 1234 | // Create a wrong commit (unique, not PRTestCommit) - use create_commit so it always |
| 1235 | if let Err(e) = create_deterministic_commit_with_variant(&clone_path, CommitVariant::Owner) | 1235 | // succeeds even when the clone already has the Owner deterministic content on disk. |
| 1236 | { | 1236 | if let Err(e) = create_commit(&clone_path, "wrong commit - not the PR test commit") { |
| 1237 | let _ = fs::remove_dir_all(&clone_path); | 1237 | let _ = fs::remove_dir_all(&clone_path); |
| 1238 | return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc).fail(&e); | 1238 | return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc).fail(&e); |
| 1239 | } | 1239 | } |