diff --git a/fix_config_fields.sh b/fix_config_fields.sh new file mode 100755 index 0000000..9658c67 --- /dev/null +++ b/fix_config_fields.sh @@ -0,0 +1,27 @@ +#\!/bin/bash + +# List of test files that need Config struct fixes +files=( +"tests/integration_config_oidc_tests.rs" +"tests/integration_source_sync_cancellation_workflow_tests.rs" +"tests/integration_source_scheduler_tests.rs" +"tests/integration_webdav_hash_duplicate_tests.rs" +"tests/integration_stop_sync_functionality_tests.rs" +"tests/integration_universal_source_sync_tests.rs" +) + +for file in "${files[@]}"; do + if [ -f "$file" ]; then + echo "Fixing $file..." + # Use sed to add the missing fields after watch_folder line + sed -i.bak '/watch_folder: /a\ + user_watch_base_dir: "./user_watch".to_string(),\ + enable_per_user_watch: false,' "$file" + + # Remove backup file + rm "${file}.bak" 2>/dev/null || true + echo "Fixed $file" + else + echo "File not found: $file" + fi +done diff --git a/tests/integration_cancellation_tests.rs b/tests/integration_cancellation_tests.rs index be7b924..4f55209 100644 --- a/tests/integration_cancellation_tests.rs +++ b/tests/integration_cancellation_tests.rs @@ -66,6 +66,7 @@ async fn create_test_app_state() -> Arc { queue_service, oidc_client: None, sync_progress_tracker, + user_watch_service: None, }) } diff --git a/tests/integration_config_oidc_tests.rs b/tests/integration_config_oidc_tests.rs index bb3e29d..7f2bef9 100644 --- a/tests/integration_config_oidc_tests.rs +++ b/tests/integration_config_oidc_tests.rs @@ -53,7 +53,8 @@ mod tests { jwt_secret: "test-secret".to_string(), upload_path: "./test-uploads".to_string(), watch_folder: "./test-watch".to_string(), - allowed_file_types: vec!["pdf".to_string()], + user_watch_base_dir: "./user_watch".to_string(), + enable_per_user_watch: false, allowed_file_types: vec!["pdf".to_string()], watch_interval_seconds: Some(30), file_stability_check_ms: Some(500), max_file_age_hours: None, diff --git a/tests/integration_source_scheduler_simple_tests.rs b/tests/integration_source_scheduler_simple_tests.rs index e4f7295..1a9a1fb 100644 --- a/tests/integration_source_scheduler_simple_tests.rs +++ b/tests/integration_source_scheduler_simple_tests.rs @@ -29,6 +29,8 @@ async fn create_test_app_state() -> Arc { jwt_secret: "test_secret".to_string(), upload_path: "/tmp/test_uploads".to_string(), watch_folder: "/tmp/watch".to_string(), + user_watch_base_dir: "./user_watch".to_string(), + enable_per_user_watch: false, allowed_file_types: vec!["pdf".to_string(), "txt".to_string()], watch_interval_seconds: Some(10), file_stability_check_ms: Some(1000), diff --git a/tests/integration_source_scheduler_tests.rs b/tests/integration_source_scheduler_tests.rs index 2ee6e1d..29ffa45 100644 --- a/tests/integration_source_scheduler_tests.rs +++ b/tests/integration_source_scheduler_tests.rs @@ -174,7 +174,8 @@ async fn create_test_app_state() -> Arc { jwt_secret: "test_secret".to_string(), upload_path: "/tmp/test_uploads".to_string(), watch_folder: "/tmp/test_watch".to_string(), - allowed_file_types: vec!["pdf".to_string(), "txt".to_string()], + user_watch_base_dir: "./user_watch".to_string(), + enable_per_user_watch: false, allowed_file_types: vec!["pdf".to_string(), "txt".to_string()], watch_interval_seconds: Some(30), file_stability_check_ms: Some(500), max_file_age_hours: None, diff --git a/tests/integration_source_sync_cancellation_workflow_tests.rs b/tests/integration_source_sync_cancellation_workflow_tests.rs index f15d15c..eb6caff 100644 --- a/tests/integration_source_sync_cancellation_workflow_tests.rs +++ b/tests/integration_source_sync_cancellation_workflow_tests.rs @@ -44,7 +44,8 @@ async fn create_test_app_state() -> Arc { jwt_secret: "test_secret_for_sync_cancellation".to_string(), upload_path: "/tmp/test_uploads_sync_cancel".to_string(), watch_folder: "/tmp/watch_sync_cancel".to_string(), - allowed_file_types: vec!["pdf".to_string(), "txt".to_string(), "jpg".to_string(), "png".to_string()], + user_watch_base_dir: "./user_watch".to_string(), + enable_per_user_watch: false, allowed_file_types: vec!["pdf".to_string(), "txt".to_string(), "jpg".to_string(), "png".to_string()], watch_interval_seconds: Some(30), file_stability_check_ms: Some(500), max_file_age_hours: Some(24), @@ -79,6 +80,7 @@ async fn create_test_app_state() -> Arc { queue_service, oidc_client: None, sync_progress_tracker, + user_watch_service: None, }; // Wrap in Arc for sharing @@ -98,6 +100,7 @@ async fn create_test_app_state() -> Arc { queue_service: state_arc.queue_service.clone(), oidc_client: None, sync_progress_tracker: state_arc.sync_progress_tracker.clone(), + user_watch_service: None, }) } diff --git a/tests/integration_stop_sync_functionality_tests.rs b/tests/integration_stop_sync_functionality_tests.rs index c2ede2b..1de3b94 100644 --- a/tests/integration_stop_sync_functionality_tests.rs +++ b/tests/integration_stop_sync_functionality_tests.rs @@ -36,7 +36,8 @@ async fn create_test_app_state() -> Arc { jwt_secret: "test_secret".to_string(), upload_path: "/tmp/test_uploads".to_string(), watch_folder: "/tmp/watch".to_string(), - allowed_file_types: vec!["pdf".to_string(), "txt".to_string()], + user_watch_base_dir: "./user_watch".to_string(), + enable_per_user_watch: false, allowed_file_types: vec!["pdf".to_string(), "txt".to_string()], watch_interval_seconds: Some(10), file_stability_check_ms: Some(1000), max_file_age_hours: Some(24), diff --git a/tests/integration_universal_source_sync_tests.rs b/tests/integration_universal_source_sync_tests.rs index 3ea6c0e..067652f 100644 --- a/tests/integration_universal_source_sync_tests.rs +++ b/tests/integration_universal_source_sync_tests.rs @@ -137,7 +137,8 @@ async fn create_test_app_state() -> Arc { jwt_secret: "test_secret".to_string(), upload_path: "/tmp/test_uploads".to_string(), watch_folder: "/tmp/test_watch".to_string(), - allowed_file_types: vec!["pdf".to_string(), "txt".to_string()], + user_watch_base_dir: "./user_watch".to_string(), + enable_per_user_watch: false, allowed_file_types: vec!["pdf".to_string(), "txt".to_string()], watch_interval_seconds: Some(30), file_stability_check_ms: Some(500), max_file_age_hours: None, diff --git a/tests/integration_webdav_hash_duplicate_tests.rs b/tests/integration_webdav_hash_duplicate_tests.rs index 5634b9c..99862ea 100644 --- a/tests/integration_webdav_hash_duplicate_tests.rs +++ b/tests/integration_webdav_hash_duplicate_tests.rs @@ -126,7 +126,9 @@ async fn create_test_app_state() -> Result> { jwt_secret: "test-secret".to_string(), upload_path: "./test-uploads".to_string(), watch_folder: "./test-watch".to_string(), - allowed_file_types: vec!["pdf".to_string(), "txt".to_string()], + user_watch_base_dir: "./user_watch".to_string(), + enable_per_user_watch: false, + allowed_file_types: vec!["pdf".to_string(), "txt".to_string()], watch_interval_seconds: Some(30), file_stability_check_ms: Some(500), max_file_age_hours: None, diff --git a/tests/integration_webdav_integration_tests.rs b/tests/integration_webdav_integration_tests.rs index 4312dde..83b43aa 100644 --- a/tests/integration_webdav_integration_tests.rs +++ b/tests/integration_webdav_integration_tests.rs @@ -85,6 +85,8 @@ async fn setup_test_app() -> (Router, Arc) { server_address: "127.0.0.1:0".to_string(), upload_path: "/tmp/test_uploads".to_string(), watch_folder: "/tmp/test_watch".to_string(), + user_watch_base_dir: "./user_watch".to_string(), + enable_per_user_watch: false, jwt_secret: "test_jwt_secret_for_integration_tests".to_string(), allowed_file_types: vec!["pdf".to_string(), "png".to_string()], watch_interval_seconds: Some(10),