diff options
author | Johannes Schleifenbaum <johannes@js-webcoding.de> | 2022-02-23 08:59:36 +0100 |
---|---|---|
committer | Johannes Schleifenbaum <johannes@js-webcoding.de> | 2022-02-24 08:42:02 +0100 |
commit | 95f3334e3ebca749c1cccc34a22f5c4cfd67b2ce (patch) | |
tree | a5d25c71ee508fa9fd93d84b214f9d6ae7417ea0 /pkgs | |
parent | dc16356f77e266327c2dd078c8d4d060ca5aa71b (diff) | |
download | nixpkgs-95f3334e3ebca749c1cccc34a22f5c4cfd67b2ce.tar nixpkgs-95f3334e3ebca749c1cccc34a22f5c4cfd67b2ce.tar.gz nixpkgs-95f3334e3ebca749c1cccc34a22f5c4cfd67b2ce.tar.bz2 nixpkgs-95f3334e3ebca749c1cccc34a22f5c4cfd67b2ce.tar.lz nixpkgs-95f3334e3ebca749c1cccc34a22f5c4cfd67b2ce.tar.xz nixpkgs-95f3334e3ebca749c1cccc34a22f5c4cfd67b2ce.tar.zst nixpkgs-95f3334e3ebca749c1cccc34a22f5c4cfd67b2ce.zip |
paperless-ng: use pytestCheckHook and reorganize the checkPhase
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/applications/office/paperless-ng/default.nix | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/pkgs/applications/office/paperless-ng/default.nix b/pkgs/applications/office/paperless-ng/default.nix index 0b8abe5d3f1..e3ca9af422c 100644 --- a/pkgs/applications/office/paperless-ng/default.nix +++ b/pkgs/applications/office/paperless-ng/default.nix @@ -165,34 +165,38 @@ py.pkgs.pythonPackages.buildPythonApplication rec { zope_interface ]; - doCheck = true; + installPhase = '' + mkdir -p $out/lib + cp -r . $out/lib/paperless-ng + chmod +x $out/lib/paperless-ng/src/manage.py + makeWrapper $out/lib/paperless-ng/src/manage.py $out/bin/paperless-ng \ + --prefix PYTHONPATH : "$PYTHONPATH" \ + --prefix PATH : "${path}" + ''; + checkInputs = with py.pkgs.pythonPackages; [ - pytest - pytest-cov pytest-django pytest-env pytest-sugar pytest-xdist factory_boy + pytestCheckHook ]; + pytestFlagsArray = [ "src" ]; + # The tests require: # - PATH with runtime binaries # - A temporary HOME directory for gnupg # - XDG_DATA_DIRS with test-specific fonts - checkPhase = '' - pushd src - PATH="${path}:$PATH" HOME=$(mktemp -d) XDG_DATA_DIRS="${liberation_ttf}/share:$XDG_DATA_DIRS" pytest - popd - ''; + preCheck = '' + export PATH="${path}:$PATH" + export HOME=$(mktemp -d) + export XDG_DATA_DIRS="${liberation_ttf}/share:$XDG_DATA_DIRS" - installPhase = '' - mkdir -p $out/lib - cp -r . $out/lib/paperless-ng - chmod +x $out/lib/paperless-ng/src/manage.py - makeWrapper $out/lib/paperless-ng/src/manage.py $out/bin/paperless-ng \ - --prefix PYTHONPATH : "$PYTHONPATH" \ - --prefix PATH : "${path}" + # Disable unneeded code coverage test + substituteInPlace src/setup.cfg \ + --replace "--cov --cov-report=html" "" ''; passthru = { |