From 08d105012de170e56fe2a234929b1393b1726f90 Mon Sep 17 00:00:00 2001 From: Marcus A. Romer Date: Mar 01 2020 08:56:21 +0000 Subject: Properly exclude failing tests As of version 4.9.0 Calibre allows to exclude individual tests with a command line parameter. Make use of this mechanism instead of modifying the source code (where possible). --- diff --git a/497810f8adb992bfecf04e8eacf4ac1340ee6fe0.patch b/497810f8adb992bfecf04e8eacf4ac1340ee6fe0.patch deleted file mode 100644 index 3a5f77c..0000000 --- a/497810f8adb992bfecf04e8eacf4ac1340ee6fe0.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 497810f8adb992bfecf04e8eacf4ac1340ee6fe0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= -Date: Tue, 20 Aug 2019 08:50:58 +0200 -Subject: [PATCH] tests: skip unrar test gracefully if module is missing - -Fedora (and probably some other distributions) cannot include unrardll -because of licensing reasons. Unfortuantely this situation is unlikely -to change in the near future. Skip the test if the module is not -available. ---- - src/calibre/test_build.py | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py -index c17a5ef785..7514d05046 100644 ---- a/src/calibre/test_build.py -+++ b/src/calibre/test_build.py -@@ -17,6 +17,10 @@ - - is_ci = os.environ.get('CI', '').lower() == 'true' - -+try: -+ import unrardll -+except ModuleNotFoundError: -+ unrardll = None - - class BuildTest(unittest.TestCase): - -@@ -236,6 +240,7 @@ def test_file_dialog_helper(self): - from calibre.gui2.win_file_dialogs import test - test() - -+ @unittest.skipUnless(unrardll, 'Module unrardll is missing') - def test_unrar(self): - from calibre.utils.unrar import test_basic - test_basic() diff --git a/calibre.spec b/calibre.spec index 4aff4b7..8071765 100644 --- a/calibre.spec +++ b/calibre.spec @@ -6,7 +6,7 @@ Name: calibre Version: 4.11.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: E-book converter and library manager License: GPLv3 URL: https://calibre-ebook.com/ @@ -30,8 +30,6 @@ Patch1: calibre-no-update.patch Patch3: calibre-nodisplay.patch # Patches that are not suitable for upstream: -# skip unrardll tests if unrardll has been removed. -Patch4: https://github.com/keszybz/calibre/commit/497810f8adb992bfecf04e8eacf4ac1340ee6fe0.patch # sgml was removed, so disable test for it. Patch5: https://github.com/keszybz/calibre/commit/01bf854923741bf8d6a6328f17d61e0ec5ac3c9f.patch @@ -171,11 +169,6 @@ chmod -x src/calibre/*/*/*/*.py \ # remove bundled MathJax rm -rvf resources/mathjax -# Skip tests that require removed fonts -sed -r -i 's/\b(test_actual_case|test_clone|test_file_add|test_file_removal|test_file_rename|test_folder_type_map_case|test_merge_file)\b/_skipped_\1/' src/calibre/ebooks/oeb/polish/tests/container.py -# Skip test that fails in mock -sed -r -i 's/\btest_bonjour\b/_skipped_\0/' src/calibre/srv/tests/loop.py - %build # unbundle MathJax CALIBRE_PY3_PORT=1 \ @@ -338,10 +331,22 @@ rm -f %{buildroot}/%{_datadir}/metainfo/calibre-ebook-viewer.appdata.xml mv %{buildroot}%{_datadir}/calibre/mathjax %{buildroot}%{_datadir}/calibre/mathjax-fedora %check -# ignore tests on 32 bit arches for now as there's a pdf issue -CALIBRE_PY3_PORT=1 python3 setup.py test \ +# skip some tests which are failing because of missing dependencies (unrar), +# problems in mock (bonjour), or they require removed fonts +# skip qt test on 32 bit arches for now as there's a pdf issue +CALIBRE_PY3_PORT=1 \ +%{__python3} setup.py test \ + --exclude-test-name unrar \ + --exclude-test-name bonjour \ + --exclude-test-name actual_case \ + --exclude-test-name clone \ + --exclude-test-name file_add \ + --exclude-test-name file_removal \ + --exclude-test-name file_rename \ + --exclude-test-name folder_type_map_case \ + --exclude-test-name merge_file \ %ifarch i686 armv7hl -|| : + --exclude-test-name qt %endif appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/calibre-gui.appdata.xml @@ -391,6 +396,9 @@ ln -s -r %{_datadir}/calibre/mathjax-fedora %{_datadir}/calibre/mathjax %{_datadir}/metainfo/*.appdata.xml %changelog +* Sun Mar 01 2020 Marcus A. Romer - 4.11.2-3 +- Properly exclude failing tests. + * Tue Feb 25 2020 Kevin Fenzi - 4.11.2-2 - Add requires on udisks2. Fixes bug #1806362