From a005132ab806b7177d4eb3e3306914841704ffec Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 26 Nov 2025 03:57:44 +0000 Subject: test: remove bad test we dont need to check the git files exist locally --- grasp-audit/src/specs/grasp01/git_clone.rs | 126 ----------------------------- 1 file changed, 126 deletions(-) (limited to 'grasp-audit/src/specs/grasp01/git_clone.rs') diff --git a/grasp-audit/src/specs/grasp01/git_clone.rs b/grasp-audit/src/specs/grasp01/git_clone.rs index cad17d2..f85f94a 100644 --- a/grasp-audit/src/specs/grasp01/git_clone.rs +++ b/grasp-audit/src/specs/grasp01/git_clone.rs @@ -165,132 +165,6 @@ impl GitCloneTests { .pass() } - /// Test that cloned repository has correct structure - /// - /// This test verifies: - /// 1. Clone creates a valid Git repository - /// 2. Repository has proper Git structure (.git/config, .git/HEAD, etc.) - /// 3. Repository is properly initialized - pub async fn test_cloned_repo_structure( - client: &AuditClient, - _git_data_dir: &Path, - relay_domain: &str, - ) -> TestResult { - let test_name = "test_cloned_repo_structure"; - let ctx = TestContext::new(client); - - // Create repository announcement - let repo = match ctx.get_fixture(FixtureKind::ValidRepo).await { - Ok(r) => r, - Err(e) => { - return TestResult::new( - test_name, - "GRASP-01", - "Cloned repository must have correct structure", - ) - .fail(&format!("Failed to create repo fixture: {}", e)) - } - }; - - // Wait for repository creation - tokio::time::sleep(std::time::Duration::from_millis(200)).await; - - // Extract repo identifier and npub - let repo_id = repo - .tags - .iter() - .find(|t| t.kind() == TagKind::d()) - .and_then(|t| t.content()) - .ok_or("Missing d tag") - .unwrap() - .to_string(); - - let npub = repo.pubkey.to_bech32().unwrap(); - - // Create temp clone directory using standard library - let temp_base = std::env::temp_dir(); - let clone_dir_name = format!("grasp-test-clone-struct-{}", uuid::Uuid::new_v4()); - let clone_path = temp_base.join(&clone_dir_name); - - // Ensure clean state - let _ = fs::remove_dir_all(&clone_path); - - // Cleanup helper - let cleanup = || { - let _ = fs::remove_dir_all(&clone_path); - }; - - // Clone the repository - let clone_url = format!("http://{}/{}/{}.git", relay_domain, npub, repo_id); - let output = Command::new("git") - .args(&["clone", &clone_url, clone_path.to_str().unwrap()]) - .env("GIT_TERMINAL_PROMPT", "0") - .output() - .unwrap(); - - if !output.status.success() { - cleanup(); - let stderr = String::from_utf8_lossy(&output.stderr); - return TestResult::new( - test_name, - "GRASP-01", - "Cloned repository must have correct structure", - ) - .fail(&format!("Git clone failed: {}", stderr)); - } - - // Verify Git repository structure - let git_dir = clone_path.join(".git"); - - if !git_dir.join("config").is_file() { - cleanup(); - return TestResult::new( - test_name, - "GRASP-01", - "Cloned repository must have correct structure", - ) - .fail("Missing .git/config file"); - } - - if !git_dir.join("HEAD").is_file() { - cleanup(); - return TestResult::new( - test_name, - "GRASP-01", - "Cloned repository must have correct structure", - ) - .fail("Missing .git/HEAD file"); - } - - if !git_dir.join("objects").is_dir() { - cleanup(); - return TestResult::new( - test_name, - "GRASP-01", - "Cloned repository must have correct structure", - ) - .fail("Missing .git/objects directory"); - } - - if !git_dir.join("refs").is_dir() { - cleanup(); - return TestResult::new( - test_name, - "GRASP-01", - "Cloned repository must have correct structure", - ) - .fail("Missing .git/refs directory"); - } - - cleanup(); - TestResult::new( - test_name, - "GRASP-01", - "Cloned repository must have correct structure", - ) - .pass() - } - /// Test clone URL format validation /// /// This test verifies: -- cgit v1.2.3