From ee4f4ad14c6940363fdae16771b555159d97da46 Mon Sep 17 00:00:00 2001 From: JB Gosselin <1536838+jbgosselin@users.noreply.github.com> Date: Wed, 30 Aug 2023 23:07:43 -0400 Subject: [PATCH 1/2] python3Packages.magic-wormhole-mailbox-server: disable tests darwin --- .../magic-wormhole-mailbox-server/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix b/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix index e47f27d806cb..fc9636c351a0 100644 --- a/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix +++ b/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix @@ -1,4 +1,5 @@ { lib +, stdenv , buildPythonPackage , fetchPypi , fetchpatch @@ -48,6 +49,12 @@ buildPythonPackage rec { twisted ]; + # Fails in Darwin's sandbox + postPatch = lib.optionalString stdenv.isDarwin '' + echo 'LogRequests.skip = "Operation not permitted"' >> src/wormhole_mailbox_server/test/test_web.py + echo 'WebSocketAPI.skip = "Operation not permitted"' >> src/wormhole_mailbox_server/test/test_web.py + ''; + checkPhase = '' trial -j$NIX_BUILD_CORES wormhole_mailbox_server ''; From 6c94b44f10745486eaa24d35547506637b719bd3 Mon Sep 17 00:00:00 2001 From: JB Gosselin <1536838+jbgosselin@users.noreply.github.com> Date: Wed, 30 Aug 2023 23:11:01 -0400 Subject: [PATCH 2/2] python3Packages.magic-wormhole: disable some tests darwin --- .../python-modules/magic-wormhole/default.nix | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pkgs/development/python-modules/magic-wormhole/default.nix b/pkgs/development/python-modules/magic-wormhole/default.nix index f462793266b9..95635b94d505 100644 --- a/pkgs/development/python-modules/magic-wormhole/default.nix +++ b/pkgs/development/python-modules/magic-wormhole/default.nix @@ -56,6 +56,31 @@ buildPythonPackage rec { disabledTests = [ # Expected: (,) Got: Failure instance: Traceback (failure with no frames): : "test_welcome" + ] ++ lib.optionals stdenv.isDarwin [ + # These tests doesn't work within Darwin's sandbox + "test_version" + "test_text" + "test_receiver" + "test_sender" + "test_sender_allocation" + "test_text_wrong_password" + "test_override" + "test_allocate_port" + "test_allocate_port_no_reuseaddr" + "test_ignore_localhost_hint" + "test_ignore_localhost_hint_orig" + "test_keep_only_localhost_hint" + "test_get_direct_hints" + "test_listener" + "test_success_direct" + "test_direct" + "test_relay" + ]; + + disabledTestPaths = lib.optionals stdenv.isDarwin [ + # These tests doesn't work within Darwin's sandbox + "src/wormhole/test/test_xfer_util.py" + "src/wormhole/test/test_wormhole.py" ]; postPatch = lib.optionalString stdenv.isLinux ''