diff --git a/zhtp-cli/scripts/run_web4_functional_tests.sh b/zhtp-cli/scripts/run_web4_functional_tests.sh index 3f4511bf..25b76268 100755 --- a/zhtp-cli/scripts/run_web4_functional_tests.sh +++ b/zhtp-cli/scripts/run_web4_functional_tests.sh @@ -25,6 +25,7 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" TEST_PHASE="${1:-all}" VERBOSE="${VERBOSE:-0}" NOCAPTURE="${NOCAPTURE:-0}" +BUILD_MODE="${BUILD_MODE:-debug}" # Color codes for output RED='\033[0;31m' diff --git a/zhtp-cli/tests/web4_functional.rs b/zhtp-cli/tests/web4_functional.rs index 7cebc511..4b9973b2 100644 --- a/zhtp-cli/tests/web4_functional.rs +++ b/zhtp-cli/tests/web4_functional.rs @@ -44,8 +44,9 @@ use std::thread; use std::time::Duration; use std::io::Write; -mod support; -use support::{TestEnv, CliExecutor, SiteGenerator, StateVerifier}; +#[path = "web4_functional/mod.rs"] +mod web4_functional_support; +use web4_functional_support::{TestEnv, CliExecutor, SiteGenerator, StateVerifier}; // ============================================================================ // PHASE 1: DOMAIN REGISTRATION TESTS @@ -123,8 +124,8 @@ fn deployment_simple_site() { site.write_to(&site_path).expect("Failed to write site"); // Deploy - let result = cli.deploy_site("simple.web4.test", &site_path); - assert!(result.success, "Deployment failed: {}", result.output); + let deploy_result = cli.deploy_site("simple.web4.test", &site_path); + assert!(deploy_result.success, "Deployment failed: {}", deploy_result.output); // Verify manifest let verify = StateVerifier::new(&env); diff --git a/zhtp-cli/tests/web4_functional/state_verifier.rs b/zhtp-cli/tests/web4_functional/state_verifier.rs index 7aca101b..0e6cc565 100644 --- a/zhtp-cli/tests/web4_functional/state_verifier.rs +++ b/zhtp-cli/tests/web4_functional/state_verifier.rs @@ -49,15 +49,16 @@ impl StateVerifier { /// Verify manifest has required fields pub fn manifest_has_fields(&self, domain: &str, required_fields: &[&str]) -> bool { - let manifest = self.get_manifest(domain)?; - - for field in required_fields { - if !manifest.contains_key(*field) { - return false; + if let Some(manifest) = self.get_manifest(domain) { + for field in required_fields { + if !manifest.contains_key(*field) { + return false; + } } + true + } else { + false } - - true } /// Get version information for a domain @@ -126,7 +127,10 @@ impl StateVerifier { /// Verify persistence: check if state is identical after restart pub fn verify_persistence(&self, domain: &str, original_state: &serde_json::Map) -> bool { - let current_state = self.get_manifest(domain)?; + let current_state = match self.get_manifest(domain) { + Some(state) => state, + None => return false, + }; // Compare critical fields let same_cid = original_state.get("web4_manifest_cid") == current_state.get("web4_manifest_cid");