Package: src:pelican
Severity: important
Control: tags -1 patch

Dear maintainers,

This package currently does not run any tests, neither during build nor as 
autopkgtests. This is pretty bad, as it means the package could be broken 
without no one realising it! BTS #1057484 is a pretty good example of why it's 
important to run tests.

I've attached a pretty trivial patch that seems to do 95% of the job. Of 
course, the last 5% is always the hardest, but from the following error log, it 
doesn't seem so bad. IMHO, even skipping those failing tests and completely 
ignoring them would already be an improvement over the current situation.

As for autopkgtests, the magic line to add to d/control is `Testsuite: 
autopkgtest-pkg-pybuild`.

======================================================================
ERROR: test_theme_overrides 
(pelican.tests.test_generators.TestGenerator.test_theme_overrides)
Test that the THEME_TEMPLATES_OVERRIDES configuration setting is
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/test_generators.py",
 line 148, in test_theme_overrides
    filename = generator.get_template("taglist").filename
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/generators.py", 
line 127, in get_template
    raise PelicanTemplateNotFound(
pelican.generators.PelicanTemplateNotFound: [templates] unable to load taglist[.html] from 
['/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/theme_overrides/level1', 
'/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/theme_overrides/level2', 
'/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/themes/simple/templates']

======================================================================
ERROR: test_md_extensions_deprecation 
(pelican.tests.test_pelican.TestPelican.test_md_extensions_deprecation)
Test that a warning is issued if MD_EXTENSIONS is used
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/test_pelican.py", 
line 234, in test_md_extensions_deprecation
    settings = read_settings(
               ^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/settings.py", 
line 213, in read_settings
    settings = configure_settings(settings)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/settings.py", 
line 575, in configure_settings
    raise Exception(
Exception: You need to specify a path containing the content (see pelican 
--help for more information)

======================================================================
ERROR: test_theme_static_paths_copy 
(pelican.tests.test_pelican.TestPelican.test_theme_static_paths_copy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/test_pelican.py", 
line 162, in test_theme_static_paths_copy
    settings = read_settings(
               ^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/settings.py", 
line 184, in read_settings
    settings = dict(get_settings_from_file(path), **settings)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/settings.py", 
line 237, in get_settings_from_file
    module = load_source(name, path)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/settings.py", 
line 19, in load_source
    spec.loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 990, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1127, in get_code
  File "<frozen importlib._bootstrap_external>", line 1185, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 
'/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/samples/pelican.conf.py'

======================================================================
ERROR: test_theme_static_paths_copy_single_file 
(pelican.tests.test_pelican.TestPelican.test_theme_static_paths_copy_single_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/test_pelican.py", 
line 188, in test_theme_static_paths_copy_single_file
    settings = read_settings(
               ^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/settings.py", 
line 184, in read_settings
    settings = dict(get_settings_from_file(path), **settings)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/settings.py", 
line 237, in get_settings_from_file
    module = load_source(name, path)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/settings.py", 
line 19, in load_source
    spec.loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 990, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1127, in get_code
  File "<frozen importlib._bootstrap_external>", line 1185, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 
'/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/samples/pelican.conf.py'

======================================================================
FAIL: test_theme_prefix 
(pelican.tests.test_generators.TestGenerator.test_theme_prefix)
Test `!theme` theme prefix.
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/test_generators.py",
 line 174, in test_theme_prefix
    self.assertEqual(expected_path, os.path.dirname(filename))
AssertionError: '/bui[38 
chars]pybuild/cpython3_3.12/build/pelican/themes/notmyidea/templates' != 
'/bui[38 chars]pybuild/cpython3_3.12/build/pelican/themes/simple/templates'
- 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/themes/notmyidea/templates
?                                                                               
       ^^^ ^^^ -
+ /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/themes/simple/templates
?                                                                               
       ^^ ^^


======================================================================
FAIL: test_theme_static_paths_dirs 
(pelican.tests.test_generators.TestStaticGenerator.test_theme_static_paths_dirs)
Test that StaticGenerator properly copies also files mentioned in
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/test_generators.py",
 line 1211, in test_theme_static_paths_dirs
    self.assertTrue(os.path.isdir(os.path.join(self.temp_output, "theme/css/")))
AssertionError: False is not true

======================================================================
FAIL: test_theme_static_paths_files 
(pelican.tests.test_generators.TestStaticGenerator.test_theme_static_paths_files)
Test that StaticGenerator properly copies also files mentioned in
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/test_generators.py",
 line 1236, in test_theme_static_paths_files
    self.assertTrue(
AssertionError: False is not true

======================================================================
FAIL: test_log_filter (pelican.tests.test_log.TestLog.test_log_filter)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/test_log.py", line 
53, in test_log_filter
    self.assertEqual(self.handler.count_logs("Log \\d", logging.WARNING), 0)
AssertionError: 5 != 0

======================================================================
FAIL: test_error_on_warning 
(pelican.tests.test_testsuite.TestSuiteTest.test_error_on_warning)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12/build/pelican/tests/test_testsuite.py",
 line 8, in test_error_on_warning
    with self.assertRaises(UserWarning):
AssertionError: UserWarning not raised

----------------------------------------------------------------------
Ran 241 tests in 2.186s

FAILED (failures=5, errors=4, skipped=30)

Cheers,

--
  ⢀⣴⠾⠻⢶⣦⠀
  ⣾⠁⢠⠒⠀⣿⡁  Louis-Philippe Véronneau
  ⢿⡄⠘⠷⠚⠋   po...@debian.org / veronneau.org
  ⠈⠳⣄
diff --git a/debian/control b/debian/control
index 0d4a471..e362968 100644
--- a/debian/control
+++ b/debian/control
@@ -26,6 +26,9 @@ Build-Depends:
  python3-tz,
  python3-unidecode,
  python3-watchfiles,
+ python3-ordered-set <!nocheck>,
+ python3-typogrify <!nocheck>,
+ python3-markdown <!nocheck>,
 Standards-Version: 4.6.2
 Homepage: https://getpelican.com/
 Vcs-Git: https://salsa.debian.org/python-team/packages/pelican.git
diff --git a/debian/rules b/debian/rules
index f5ee1db..f2ecb0b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,9 +16,6 @@ override_dh_auto_build:
 	PYTHONPATH=. http_proxy='http://127.0.0.1:9/' python3 -m sphinx -N -E -bhtml docs build/html
 	rm -rf build/html/.doctrees
 
-override_dh_auto_test:
-	@echo "Tests currently disabled!"
-
 override_dh_installchangelogs:
 	dh_installchangelogs docs/changelog.rst
 

Reply via email to