fix(tests): resolve issues with new config fields for user_watch in tests
This commit is contained in:
parent
ffb33ae5ab
commit
2a87b9ffd2
|
|
@ -0,0 +1,56 @@
|
|||
#\!/bin/bash
|
||||
|
||||
# Files with missing Config fields
|
||||
config_files=(
|
||||
"tests/integration_smart_sync_targeted_scan.rs"
|
||||
"tests/integration_s3_sync_tests.rs"
|
||||
"tests/unit_webdav_edge_cases_tests.rs"
|
||||
"tests/unit_webdav_url_management_tests.rs"
|
||||
"tests/integration_webdav_concurrency_tests.rs"
|
||||
"tests/integration_smart_sync_error_handling.rs"
|
||||
"tests/integration_webdav_sync_tests.rs"
|
||||
"tests/unit_webdav_directory_tracking_tests.rs"
|
||||
"tests/unit_basic_sync_tests.rs"
|
||||
"tests/unit_webdav_unit_tests.rs"
|
||||
"tests/integration_webdav_smart_scanning_tests.rs"
|
||||
"tests/unit_webdav_enhanced_unit_tests.rs"
|
||||
"tests/integration_webdav_scheduler_concurrency_tests.rs"
|
||||
"tests/integration_smart_sync_deep_scan.rs"
|
||||
"tests/integration_smart_sync_no_changes.rs"
|
||||
"tests/integration_local_folder_sync_tests.rs"
|
||||
"tests/webdav_production_flow_integration_tests.rs"
|
||||
"tests/integration_webdav_first_time_scan_tests.rs"
|
||||
"tests/unit_webdav_targeted_rescan_tests.rs"
|
||||
"tests/integration_smart_sync_first_time.rs"
|
||||
"tests/unit_smart_sync_service_tests.rs"
|
||||
"tests/unit_webdav_smart_scan_logic_tests.rs"
|
||||
)
|
||||
|
||||
echo "Fixing Config structs in ${#config_files[@]} files..."
|
||||
|
||||
for file in "${config_files[@]}"; do
|
||||
if [ -f "$file" ]; then
|
||||
echo "Processing $file..."
|
||||
# Check if file has Config struct and missing fields
|
||||
if grep -q "Config {" "$file" && \! grep -q "user_watch_base_dir" "$file"; then
|
||||
# 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"
|
||||
|
||||
# Clean up formatting
|
||||
sed -i 's/enable_per_user_watch: false, /enable_per_user_watch: false,\n /' "$file"
|
||||
sed -i 's/enable_per_user_watch: false, /enable_per_user_watch: false,\n /' "$file"
|
||||
|
||||
# Remove backup
|
||||
rm "${file}.bak" 2>/dev/null || true
|
||||
echo "Fixed Config in $file"
|
||||
else
|
||||
echo "Skipping $file (no Config struct or already fixed)"
|
||||
fi
|
||||
else
|
||||
echo "File not found: $file"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Config fixes completed."
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
#\!/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
|
||||
Loading…
Reference in New Issue