diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-18 22:12:22 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-18 22:12:22 +0000 |
| commit | fefb37e040eb3cf91093d597737e1431fed38c81 (patch) | |
| tree | 62be13f2855f4672273061426312e80956b23fce /grasp-audit/src/specs/grasp01/push_authorization.rs | |
| parent | 1f0298bcfe125bee5d996e163ad8f3e9c17e3a9e (diff) | |
fix: use unique commit instead of deterministic Owner variant for wrong-commit PR tests
PRWrongCommitPushedBeforeEvent and test_push_to_nostr_ref_with_wrong_commit_after_event_received_rejected
were calling create_deterministic_commit_with_variant(CommitVariant::Owner) on a clone that already
had test.txt with 'Initial commit\n' content from OwnerStateDataPushed. Writing identical content
staged nothing so git commit failed silently.
Now that ValidRepoServed always depends on OwnerStateDataPushed (git data pushed), the clone is
never empty - use create_commit (unique file) instead since the wrong commit only needs to differ
from PR_TEST_COMMIT_HASH, not be deterministic.
Diffstat (limited to 'grasp-audit/src/specs/grasp01/push_authorization.rs')
| -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 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 | } |