From 982ec514ae046b36d6be259e95a2816bd47873cb Mon Sep 17 00:00:00 2001 From: teutat3s <10206665+teutat3s@users.noreply.github.com> Date: Mon, 31 Mar 2025 14:48:53 +0200 Subject: [PATCH] open-policy-agent: skip tests that require network These tests do not work in the nix sandbox. --- pkgs/by-name/op/open-policy-agent/package.nix | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/op/open-policy-agent/package.nix b/pkgs/by-name/op/open-policy-agent/package.nix index c076679fef2a..2285ad4b44c2 100644 --- a/pkgs/by-name/op/open-policy-agent/package.nix +++ b/pkgs/by-name/op/open-policy-agent/package.nix @@ -43,9 +43,24 @@ buildGoModule rec { ) "opa_wasm" ); - checkFlags = lib.optionals (!enableWasmEval) [ - "-skip=TestRegoTargetWasmAndTargetPluginDisablesIndexingTopdownStages" - ]; + checkFlags = + let + skippedTests = + [ + # Skip tests that require network, not available in the nix sandbox + "TestInterQueryCache_ClientError" + "TestIntraQueryCache_ClientError" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Skip tests that require network, not available in the darwin sandbox + "TestHTTPSClient" + "TestHTTPSNoClientCerts" + ] + ++ lib.optionals (!enableWasmEval) [ + "TestRegoTargetWasmAndTargetPluginDisablesIndexingTopdownStages" + ]; + in + [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; preCheck = ''