diff options
author | Martin Weinelt <mweinelt@users.noreply.github.com> | 2022-03-05 01:18:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-05 01:18:32 +0100 |
commit | 0a4ef1dae9c8a9f46f5ca088bda99c06d9472e9f (patch) | |
tree | 129f7223a7fca807b3acdcc2a5789f44795462a3 /pkgs/applications/office | |
parent | 041689514562b87c6a0941b896fba76ded30a0bf (diff) | |
parent | 95f3334e3ebca749c1cccc34a22f5c4cfd67b2ce (diff) | |
download | nixpkgs-0a4ef1dae9c8a9f46f5ca088bda99c06d9472e9f.tar nixpkgs-0a4ef1dae9c8a9f46f5ca088bda99c06d9472e9f.tar.gz nixpkgs-0a4ef1dae9c8a9f46f5ca088bda99c06d9472e9f.tar.bz2 nixpkgs-0a4ef1dae9c8a9f46f5ca088bda99c06d9472e9f.tar.lz nixpkgs-0a4ef1dae9c8a9f46f5ca088bda99c06d9472e9f.tar.xz nixpkgs-0a4ef1dae9c8a9f46f5ca088bda99c06d9472e9f.tar.zst nixpkgs-0a4ef1dae9c8a9f46f5ca088bda99c06d9472e9f.zip |
Merge pull request #158118 from jojosch/paperless-ng-disable-broken-tests
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r-- | pkgs/applications/office/paperless-ng/default.nix | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/pkgs/applications/office/paperless-ng/default.nix b/pkgs/applications/office/paperless-ng/default.nix index 2fcb2388b8c..e3ca9af422c 100644 --- a/pkgs/applications/office/paperless-ng/default.nix +++ b/pkgs/applications/office/paperless-ng/default.nix @@ -1,5 +1,6 @@ { lib , fetchurl +, fetchpatch , nixosTests , python3 , ghostscript @@ -54,6 +55,15 @@ py.pkgs.pythonPackages.buildPythonApplication rec { sha256 = "oVSq0AWksuWC81MF5xiZ6ZbdKKtqqphmL+xIzJLaDMw="; }; + patches = [ + # Fix the `slow_write_pdf` test: + # https://github.com/NixOS/nixpkgs/issues/136626 + (fetchpatch { + url = "https://github.com/paperless-ngx/paperless-ngx/commit/4fbabe43ea12811864e9676b04d82a82b38e799d.patch"; + sha256 = "sha256-8ULep5aeW3wJAQGy2OEAjFYybELNq1DzCC1uBrZx36I="; + }) + ]; + format = "other"; # Make bind address configurable @@ -155,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 = { |