Unverified Commit e87fc0b4 authored by asymmetric's avatar asymmetric Committed by GitHub
Browse files

Merge pull request #252488 from jbgosselin/python/magic-wormhole/fix-tests-darwin-sandbox

python3Packages.magic-wormhole{,-mailbox-server}: fix tests in darwin sandbox
parents 8c27922a 6c94b44f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
{ 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
  '';
+25 −0
Original line number Diff line number Diff line
@@ -56,6 +56,31 @@ buildPythonPackage rec {
  disabledTests = [
    # Expected: (<class 'wormhole.errors.WrongPasswordError'>,) Got: Failure instance: Traceback (failure with no frames): <class 'wormhole.errors.LonelyError'>:
    "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 ''