diff --git a/maskfile.md b/maskfile.md index 25af371..3c3a75f 100644 --- a/maskfile.md +++ b/maskfile.md @@ -408,3 +408,25 @@ PowerShell: ```powershell hurl -i tests/fixtures/hurl/endpoints.hurl ``` + +## debug-test (test) + +> Run a single test with debug output + +- test + - flags: -t, --test + - type: string + - desc: Only run the specified test target + - required + +Bash: + +```bash +$env:RUST_LOG="debug"; cargo test --package rustic_server --lib -- $test --exact --nocapture --show-output +``` + +PowerShell: + +```powershell +$env:RUST_LOG="debug"; cargo test --package rustic_server --lib -- $test --exact --nocapture --show-output +``` diff --git a/src/handlers/file_config.rs b/src/handlers/file_config.rs index 5cc0f99..dd7c4aa 100644 --- a/src/handlers/file_config.rs +++ b/src/handlers/file_config.rs @@ -218,7 +218,7 @@ mod test { // ----------------------- // Create a new repository // ----------------------- - let repo_name_uri = ["/", &repo, "?create=true"].concat(); + let repo_name_uri = ["/", &repo, "/", "?create=true"].concat(); let app = Router::new() .typed_post(create_repository::) .layer(middleware::from_fn(print_request_response)); @@ -307,7 +307,7 @@ mod test { // ----------------------- // CLEAN UP DELETE REPO // ----------------------- - let repo_name_uri = ["/", &repo].concat(); + let repo_name_uri = ["/", &repo, "/"].concat(); let app = Router::new() .typed_delete(delete_repository::) .layer(middleware::from_fn(print_request_response)); diff --git a/src/handlers/files_list.rs b/src/handlers/files_list.rs index d6ba917..23086a6 100644 --- a/src/handlers/files_list.rs +++ b/src/handlers/files_list.rs @@ -172,7 +172,7 @@ mod test { .layer(middleware::from_fn(print_request_response)); let request = Request::builder() - .uri("/test_repo/keys") + .uri("/test_repo/keys/") .header(ACCEPT, ApiVersionKind::V1.to_static_str()) .header( "Authorization", @@ -220,7 +220,7 @@ mod test { .layer(middleware::from_fn(print_request_response)); let request = Request::builder() - .uri("/test_repo/keys") + .uri("/test_repo/keys/") .header(ACCEPT, ApiVersionKind::V2.to_static_str()) .header( "Authorization", diff --git a/src/handlers/repository.rs b/src/handlers/repository.rs index ed9337d..a3f6c87 100644 --- a/src/handlers/repository.rs +++ b/src/handlers/repository.rs @@ -131,7 +131,7 @@ mod test { // ------------------------------------ // Create a new repository: {path}?create=true // ------------------------------------ - let repo_name_uri = "/repo_remove_me?create=true".to_string(); + let repo_name_uri = "/repo_remove_me/?create=true".to_string(); let app = Router::new() .typed_post(create_repository::) .layer(middleware::from_fn(print_request_response)); @@ -145,7 +145,7 @@ mod test { // ------------------------------------------ // Create a new repository WITHOUT ACL access // ------------------------------------------ - let repo_name_uri = "/repo_not_allowed?create=true".to_string(); + let repo_name_uri = "/repo_not_allowed/?create=true".to_string(); let app = Router::new() .typed_post(create_repository::) .layer(middleware::from_fn(print_request_response)); @@ -159,7 +159,7 @@ mod test { // ------------------------------------------ // Delete a repository WITHOUT ACL access // ------------------------------------------ - let repo_name_uri = "/repo_remove_me?create=true".to_string(); + let repo_name_uri = "/repo_remove_me/?create=true".to_string(); let app = Router::new() .typed_delete(delete_repository::) .layer(middleware::from_fn(print_request_response)); @@ -183,7 +183,7 @@ mod test { // Delete a repository WITH access... // ------------------------------------------ assert!(path.exists()); // pre condition: repo exists - let repo_name_uri = "/repo_remove_me".to_string(); + let repo_name_uri = "/repo_remove_me/".to_string(); let app = Router::new() .typed_delete(delete_repository::) .layer(middleware::from_fn(print_request_response));