From 95c70ad3e86b9b9aab227bfdc2cf220c7dbeab47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Wed, 2 Nov 2022 16:27:46 +0100 Subject: [PATCH] Disable tests requiring Docker under Windows GitHub Actions --- test/test.ml | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/test/test.ml b/test/test.ml index 67706890..ad5c33ce 100644 --- a/test/test.ml +++ b/test/test.ml @@ -775,18 +775,7 @@ let () = in test_case name speed wrap in - Lwt_main.run begin - let manifest = - if not Sys.win32 then [test_case "Copy using Manifest" `Quick test_copy_ocaml] - else [] - in - run "OBuilder" [ - "spec", [ - test_case_sync "Sexp" `Quick test_sexp; - test_case_sync "Cache ID" `Quick test_cache_id; - test_case_sync "Docker Windows" `Quick test_docker_windows; - test_case_sync "Docker UNIX" `Quick test_docker_unix; - ]; + let needs_docker = [ "build", [ test_case "Simple" `Quick test_simple; test_case "Prune" `Quick test_prune; @@ -801,8 +790,25 @@ let () = test_case "Delete" `Quick test_delete; ]; "secrets", [ - test_case "Simple" `Quick test_secrets_simple; - test_case "No secret provided" `Quick test_secrets_not_provided; + test_case "Simple" `Quick test_secrets_simple; + test_case "No secret provided" `Quick test_secrets_not_provided; + ]; + ] in + let is_win32_gha = + match Sys.getenv "CI", Sys.getenv "GITHUB_ACTIONS", Sys.win32 with + | "true", "true", true -> false + | _ | exception _ -> true in + Lwt_main.run begin + let manifest = + if not Sys.win32 then [test_case "Copy using Manifest" `Quick test_copy_ocaml] + else [] + in + run "OBuilder" ([ + "spec", [ + test_case_sync "Sexp" `Quick test_sexp; + test_case_sync "Cache ID" `Quick test_cache_id; + test_case_sync "Docker Windows" `Quick test_docker_windows; + test_case_sync "Docker UNIX" `Quick test_docker_unix; ]; "tar_transfer", [ test_case "Long filename" `Quick test_tar_long_filename; @@ -812,5 +818,5 @@ let () = test_case "Execute a process" `Quick test_exec_nul; test_case "Read stdout of a process" `Quick test_pread_nul; ]; - ] + ] @ (if not is_win32_gha then needs_docker else [])) end