upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/grasp-audit
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-01 20:45:48 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-01 20:45:48 +0000
commita21a795b20f89eafde52b1fecc01ba6ddb1bad56 (patch)
tree9e56dc46f6e3e7f48baf0d615ab6e4a7e2466da2 /grasp-audit
parentd0592943867b7003b30a778acff8fcc43c041e34 (diff)
test placeholder: test_head_set_after_git_push_with_required_oids
Diffstat (limited to 'grasp-audit')
-rw-r--r--grasp-audit/src/specs/grasp01/push_authorization.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/grasp-audit/src/specs/grasp01/push_authorization.rs b/grasp-audit/src/specs/grasp01/push_authorization.rs
index a4731ae..cd422d2 100644
--- a/grasp-audit/src/specs/grasp01/push_authorization.rs
+++ b/grasp-audit/src/specs/grasp01/push_authorization.rs
@@ -514,6 +514,8 @@ impl PushAuthorizationTests {
514 results.add( 514 results.add(
515 Self::test_head_set_after_state_event_with_existing_commit(client, relay_domain).await, 515 Self::test_head_set_after_state_event_with_existing_commit(client, relay_domain).await,
516 ); 516 );
517 results
518 .add(Self::test_head_set_after_git_push_with_required_oids(client, relay_domain).await);
517 519
518 results 520 results
519 } 521 }
@@ -2236,6 +2238,39 @@ impl PushAuthorizationTests {
2236 )) 2238 ))
2237 } 2239 }
2238 } 2240 }
2241
2242 /// Test that HEAD is set after git push with oids
2243 pub async fn test_head_set_after_git_push_with_required_oids(
2244 client: &AuditClient,
2245 relay_domain: &str,
2246 ) -> TestResult {
2247 let test_name = "test_head_set_after_git_push_with_required_oids";
2248 let desc = "HEAD is set to match state event when git push sends required oids to formulate branch";
2249
2250 // DO the above as prep. then create a unique commit, create state event with HEAD=develop1 branch at unqiue commit
2251 // git push the new develop1 branch. then check HEAD with this:
2252 // let default_branch =
2253 // match get_default_branch_from_info_refs(relay_domain, &npub, &repo_id).await {
2254 // Ok(branch) => branch,
2255 // Err(e) => {
2256 // return TestResult::new(test_name, "GRASP-01", desc)
2257 // .fail(format!("Failed to get default branch: {}", e));
2258 // }
2259 // };
2260
2261 // // Verify HEAD points to refs/heads/develop1
2262 // if default_branch == "refs/heads/develop1" {
2263 // TestResult::new(test_name, "GRASP-01", desc).pass()
2264 // } else {
2265 // TestResult::new(test_name, "GRASP-01", desc).fail(format!(
2266 // "Expected HEAD to point to 'refs/heads/develop' but got '{}'. \
2267 // GRASP-01 requires: 'MUST set repository HEAD per repository state announcement \
2268 // as soon as the git data related to that branch has been received.'",
2269 // default_branch
2270 // ))
2271 // }
2272 TestResult::new(test_name, "GRASP-01", desc).fail("test not implemented")
2273 }
2239} 2274}
2240 2275
2241#[cfg(test)] 2276#[cfg(test)]