test: remove test covered elsewhere

as new feature purgatory is going to complicate having this test here.
it will be better to have this covered in push authorisation
This commit is contained in:
DanConwayDev
2025-12-23 14:00:50 +00:00
parent 2ce9b2831e
commit ea3f90d395
2 changed files with 0 additions and 77 deletions
@@ -110,9 +110,6 @@ impl EventAcceptancePolicyTests {
results.add(Self::test_reject_repo_announcement_missing_relays_tag(client).await);
results.add(Self::test_accept_maintainer_announcement_without_service_listed(client).await);
// Repository State Announcement Tests
results.add(Self::test_accept_valid_repo_state_announcement(client).await);
// Group 1: Accept Events Tagging Accepted Repositories
results.add(Self::test_accept_issue_via_a_tag(client).await);
results.add(Self::test_accept_comment_via_capital_a_tag(client).await);
@@ -536,79 +533,6 @@ impl EventAcceptancePolicyTests {
.await
}
// ============================================================
// Repository State Announcement Tests
// ============================================================
/// Test: Accept valid repository state announcements
///
/// Spec: Line 7 of ../grasp/01.md
/// Requirement: MUST accept repo state announcements with d, maintainers, and r tags
///
/// **EXAMPLE: Using TestContext pattern for fixture management**
/// This test demonstrates the new TestContext pattern:
/// - In CI mode: Creates fresh repo for full isolation
/// - In Production mode: Reuses cached repo to minimize events
pub async fn test_accept_valid_repo_state_announcement(client: &AuditClient) -> TestResult {
TestResult::new(
"accept_valid_repo_state_announcement",
"GRASP-01:nostr-relay:7",
"Accept valid state announcements after repo announcement accepted",
)
.run(|| async {
// Create TestContext for mode-aware fixture management
let ctx = TestContext::new(client);
// Use OwnerStateDataPushed which handles the complete flow:
// 1. Creates repo announcement
// 2. Pushes git data with the deterministic commit
// 3. Sends the state announcement
// This ensures the state event references a commit that actually exists
let state_event = ctx
.get_fixture(FixtureKind::OwnerStateDataPushed)
.await
.map_err(|e| {
format!(
"Test setup failed: could not get repository state fixture: {}",
e
)
})?;
// Extract repo_id from the state event
let repo_id = state_event
.tags
.iter()
.find(|t| t.kind() == TagKind::d())
.and_then(|t| t.content())
.ok_or("Missing d tag in state announcement")?
.to_string();
let event_id = state_event.id;
// Query back to verify it was accepted and stored
let filter = Filter::new()
.kind(Kind::Custom(30618))
.author(client.public_key())
.identifier(&repo_id);
let events = client
.query(filter)
.await
.map_err(|e| format!("Failed to query events from relay: {}", e))?;
// Verify we got the event back
if events.is_empty() {
return Err(format!(
"Event was not stored in relay (possibly rejected). Event ID: {}, Repo ID: {}",
event_id, repo_id
));
}
Ok(())
})
.await
}
// ============================================================
// Helper Functions (6 total)
// ============================================================
-1
View File
@@ -60,7 +60,6 @@ isolated_test!(test_accept_valid_repo_announcement);
isolated_test!(test_reject_repo_announcement_missing_clone_tag);
isolated_test!(test_reject_repo_announcement_missing_relays_tag);
isolated_test!(test_accept_maintainer_announcement_without_service_listed);
isolated_test!(test_accept_valid_repo_state_announcement);
isolated_test!(test_accept_issue_via_a_tag);
isolated_test!(test_accept_comment_via_capital_a_tag);
isolated_test!(test_accept_kind1_via_q_tag);