From f9229cd1571ff0b6bead15747d5786e0a264d3a2 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sun, 28 Aug 2022 12:00:00 +0000 Subject: [PATCH] python3.pkgs.paperwork-backend: fix flaky test --- pkgs/applications/office/paperwork/flaky_test.patch | 12 ++++++++++++ .../office/paperwork/paperwork-backend.nix | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 pkgs/applications/office/paperwork/flaky_test.patch diff --git a/pkgs/applications/office/paperwork/flaky_test.patch b/pkgs/applications/office/paperwork/flaky_test.patch new file mode 100644 index 000000000000..db805f8a0bc4 --- /dev/null +++ b/pkgs/applications/office/paperwork/flaky_test.patch @@ -0,0 +1,12 @@ +diff --git a/paperwork-backend/tests/docimport/tests_converted.py b/paperwork-backend/tests/docimport/tests_converted.py +index 1d1ae39b..bda63fce 100644 +--- a/paperwork-backend/tests/docimport/tests_converted.py ++++ b/paperwork-backend/tests/docimport/tests_converted.py +@@ -102,6 +102,7 @@ class TestConvertedImport(unittest.TestCase): + ) + ) + ++ @unittest.skip("flaky test: https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/issues/1035#note_1493700") + def test_import_duplicated_docx(self): + with tempfile.TemporaryDirectory() as tmp_dir: + self.config.settings = { diff --git a/pkgs/applications/office/paperwork/paperwork-backend.nix b/pkgs/applications/office/paperwork/paperwork-backend.nix index 9e20873adbb4..b9e78246609b 100644 --- a/pkgs/applications/office/paperwork/paperwork-backend.nix +++ b/pkgs/applications/office/paperwork/paperwork-backend.nix @@ -31,7 +31,14 @@ buildPythonPackage rec { sourceRoot = "source/paperwork-backend"; - patchPhase = '' + patches = [ + # disables a flaky test https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/issues/1035#note_1493700 + ./flaky_test.patch + ]; + + patchFlags = [ "-p2" ]; + + postPatch = '' echo 'version = "${version}"' > src/paperwork_backend/_version.py chmod a+w -R .. patchShebangs ../tools