From 3ded32777177c123f2a717caa244bbe9e2e4dd40 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Wed, 10 Jul 2024 17:50:01 +0200 Subject: [PATCH] anki: disable test_create_open Fails in nix-portable with bwrap, where it is able to attach `/attachroot.anki2` when it shouldn't --- pkgs/games/anki/default.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix index 9247337621bf..5f4677c301b1 100644 --- a/pkgs/games/anki/default.nix +++ b/pkgs/games/anki/default.nix @@ -250,13 +250,26 @@ python3.pkgs.buildPythonApplication { ''; # mimic https://github.com/ankitects/anki/blob/76d8807315fcc2675e7fa44d9ddf3d4608efc487/build/ninja_gen/src/python.rs#L232-L250 - checkPhase = '' + checkPhase = let + disabledTestsString = lib.pipe [ + # assumes / is not writeable, somehow fails on nix-portable brwap + "test_create_open" + ] [ + (lib.map (test: "not ${test}")) + (lib.concatStringsSep " and ") + lib.escapeShellArg + ]; + + in '' + runHook preCheck HOME=$TMP ANKI_TEST_MODE=1 PYTHONPATH=$PYTHONPATH:$PWD/out/pylib \ - pytest -p no:cacheprovider pylib/tests + pytest -p no:cacheprovider pylib/tests -k ${disabledTestsString} HOME=$TMP ANKI_TEST_MODE=1 PYTHONPATH=$PYTHONPATH:$PWD/out/pylib:$PWD/pylib:$PWD/out/qt \ - pytest -p no:cacheprovider qt/tests + pytest -p no:cacheprovider qt/tests -k ${disabledTestsString} + runHook postCheck ''; + preInstall = '' mkdir dist mv out/wheels/* dist