1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 19:51:17 +00:00

anki: disable test_create_open

Fails in nix-portable with bwrap, where it is able to attach `/attachroot.anki2` when it shouldn't
This commit is contained in:
Peder Bergebakken Sundt 2024-07-10 17:50:01 +02:00
parent af97b0ce1a
commit 3ded327771

View file

@ -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