test placeholder: test_head_set_after_git_push_with_required_oids

This commit is contained in:
DanConwayDev
2025-12-01 20:45:48 +00:00
parent d059294386
commit a21a795b20
2 changed files with 36 additions and 0 deletions
@@ -514,6 +514,8 @@ impl PushAuthorizationTests {
results.add(
Self::test_head_set_after_state_event_with_existing_commit(client, relay_domain).await,
);
results
.add(Self::test_head_set_after_git_push_with_required_oids(client, relay_domain).await);
results
}
@@ -2236,6 +2238,39 @@ impl PushAuthorizationTests {
))
}
}
/// Test that HEAD is set after git push with oids
pub async fn test_head_set_after_git_push_with_required_oids(
client: &AuditClient,
relay_domain: &str,
) -> TestResult {
let test_name = "test_head_set_after_git_push_with_required_oids";
let desc = "HEAD is set to match state event when git push sends required oids to formulate branch";
// DO the above as prep. then create a unique commit, create state event with HEAD=develop1 branch at unqiue commit
// git push the new develop1 branch. then check HEAD with this:
// let default_branch =
// match get_default_branch_from_info_refs(relay_domain, &npub, &repo_id).await {
// Ok(branch) => branch,
// Err(e) => {
// return TestResult::new(test_name, "GRASP-01", desc)
// .fail(format!("Failed to get default branch: {}", e));
// }
// };
// // Verify HEAD points to refs/heads/develop1
// if default_branch == "refs/heads/develop1" {
// TestResult::new(test_name, "GRASP-01", desc).pass()
// } else {
// TestResult::new(test_name, "GRASP-01", desc).fail(format!(
// "Expected HEAD to point to 'refs/heads/develop' but got '{}'. \
// GRASP-01 requires: 'MUST set repository HEAD per repository state announcement \
// as soon as the git data related to that branch has been received.'",
// default_branch
// ))
// }
TestResult::new(test_name, "GRASP-01", desc).fail("test not implemented")
}
}
#[cfg(test)]
+1
View File
@@ -69,3 +69,4 @@ isolated_push_test!(test_pr_event_published_removes_nostr_ref_at_incorrect_commi
isolated_push_test!(test_push_to_nostr_ref_with_wrong_commit_after_event_received_rejected);
isolated_push_test!(test_push_to_nostr_ref_with_correct_commit_after_event_received_accepted);
isolated_push_test!(test_head_set_after_state_event_with_existing_commit);
isolated_push_test!(test_head_set_after_git_push_with_required_oids);