Bug#969753: diffoscope: autopkgtest failures

Gianfranco Costamagna locutusofborg at debian.org
Mon Sep 7 19:53:13 BST 2020


Source: diffoscope
Version: 159
Severity: serious

Hello, autopkgtests looks sad, pytest-with-recommends works, while pytest doesn't, because of missing pgpdump

I did add some @skip_unless_tools_exist("pgpdump") around the failing tests (attached the diff), however I don't know
if this is the right solution, or something better has to be implemented.

G.
-------------- next part --------------
diff -Nru diffoscope-158/debian/changelog diffoscope-158ubuntu1/debian/changelog
--- diffoscope-158/debian/changelog	2020-08-28 12:53:10.000000000 +0200
+++ diffoscope-158ubuntu1/debian/changelog	2020-09-07 20:46:23.000000000 +0200
@@ -1,3 +1,9 @@
+diffoscope (159ubuntu1) groovy; urgency=medium
+
+  * Skip some tests if pgpdump is not installed
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Mon, 07 Sep 2020 20:46:23 +0200
+
 diffoscope (159) unstable; urgency=medium
 
   [ Chris Lamb ]
diff -Nru diffoscope-158/tests/comparators/test_binary.py diffoscope-158ubuntu1/tests/comparators/test_binary.py
--- diffoscope-158/tests/comparators/test_binary.py	2020-08-28 12:53:10.000000000 +0200
+++ diffoscope-158ubuntu1/tests/comparators/test_binary.py	2020-09-07 20:01:52.000000000 +0200
@@ -48,10 +48,12 @@
 binary2 = init_fixture(TEST_FILE2_PATH)
 
 
+ at skip_unless_tools_exist("pgpdump")
 def test_same_content(binary1):
     assert binary1.has_same_content_as(binary1) is True
 
 
+ at skip_unless_tools_exist("pgpdump")
 def test_not_same_content(binary1, binary2):
     assert binary1.has_same_content_as(binary2) is False
 
@@ -76,18 +78,20 @@
     assert File.guess_encoding(TEST_ISO8859_PATH) == "iso-8859-1"
 
 
-def test_no_differences_with_xxd(binary1):
+ at skip_unless_tools_exist("pgpdump")
+def test_no_differences_with_xxd(binary1):
     difference = binary1.compare_bytes(binary1)
     assert difference is None
 
 
- at skip_unless_tools_exist("xxd")
+ at skip_unless_tools_exist("xxd", "pgpdump")
 def test_compare_with_xxd(binary1, binary2):
     difference = binary1.compare_bytes(binary2)
     expected_diff = get_data("binary_expected_diff")
     assert normalize_zeros(difference.unified_diff) == expected_diff
 
 
+ at skip_unless_tools_exist("pgpdump")
 def test_compare_non_existing_with_xxd(binary1):
     difference = binary1.compare_bytes(MissingFile("/nonexisting", binary1))
     assert difference.source2 == "/nonexisting"
@@ -101,11 +105,13 @@
     monkeypatch.setattr(Xxd, "cmdline", mock_cmdline)
 
 
+ at skip_unless_tools_exist("pgpdump")
 def test_no_differences_without_xxd(xxd_not_found, binary1):
     difference = binary1.compare_bytes(binary1)
     assert difference is None
 
 
+ at skip_unless_tools_exist("pgpdump")
 def test_compare_without_xxd(xxd_not_found, binary1, binary2):
     difference = binary1.compare(binary2)
     expected_diff = get_data("binary_hexdump_expected_diff")
diff -Nru diffoscope-158/tests/comparators/test_haskell.py diffoscope-158ubuntu1/tests/comparators/test_haskell.py
--- diffoscope-158/tests/comparators/test_haskell.py	2020-08-28 12:53:10.000000000 +0200
+++ diffoscope-158ubuntu1/tests/comparators/test_haskell.py	2020-09-07 20:03:29.000000000 +0200
@@ -38,6 +38,7 @@
     assert isinstance(haskell1, HiFile)
 
 
+ at skip_unless_tools_exist("pgpdump")
 def test_no_differences(haskell1):
     assert haskell1.compare(haskell1) is None
 
diff -Nru diffoscope-158/tests/comparators/test_pgp.py diffoscope-158ubuntu1/tests/comparators/test_pgp.py
--- diffoscope-158/tests/comparators/test_pgp.py	2020-08-28 12:53:10.000000000 +0200
+++ diffoscope-158ubuntu1/tests/comparators/test_pgp.py	2020-09-07 20:43:15.000000000 +0200
@@ -70,6 +70,7 @@
     assert len(difference.details) == 1
 
 
+ at skip_unless_tools_exist("pgpdump")
 def test_signed_identification(signed1):
     assert isinstance(signed1, PgpFile)
 
diff -Nru diffoscope-158/tests/comparators/test_ppu.py diffoscope-158ubuntu1/tests/comparators/test_ppu.py
--- diffoscope-158/tests/comparators/test_ppu.py	2020-08-28 12:53:10.000000000 +0200
+++ diffoscope-158ubuntu1/tests/comparators/test_ppu.py	2020-09-07 20:44:53.000000000 +0200
@@ -51,6 +51,7 @@
     assert isinstance(file1, PpuFile)
 
 
+ at skip_unless_tools_exist("pgpdump")
 def test_no_differences(file1):
     assert file1.compare(file1) is None
 
diff -Nru diffoscope-158/tests/comparators/test_rlib.py diffoscope-158ubuntu1/tests/comparators/test_rlib.py
--- diffoscope-158/tests/comparators/test_rlib.py	2020-08-28 12:53:10.000000000 +0200
+++ diffoscope-158ubuntu1/tests/comparators/test_rlib.py	2020-09-07 20:46:22.000000000 +0200
@@ -80,12 +80,12 @@
     return get_data(diff_file)
 
 
- at skip_unless_tools_exist("nm")
+ at skip_unless_tools_exist("nm", "pgpdump")
 def test_num_items(differences):
     assert len(differences) == 4
 
 
- at skip_unless_tools_exist("nm")
+ at skip_unless_tools_exist("nm", "pgpdump")
 @skip_if_binutils_does_not_support_x86()
 def test_item0_armap(differences):
     assert differences[0].source1 == "nm -s {}"
@@ -94,7 +94,7 @@
     assert differences[0].unified_diff == expected_diff
 
 
- at skip_unless_tools_exist("nm")
+ at skip_unless_tools_exist("nm", "pgpdump")
 @skip_if_binutils_does_not_support_x86()
 def test_item1_elf(differences):
     assert differences[1].source1 == "alloc_system-d16b8f0e.0.o"
@@ -103,7 +103,7 @@
     assert differences[1].details[0].unified_diff == expected_diff
 
 
- at skip_unless_tools_exist("nm")
+ at skip_unless_tools_exist("nm", "pgpdump")
 def test_item2_rust_metadata_bin(differences):
     assert differences[2].source1 == "rust.metadata.bin"
     assert differences[2].source2 == "rust.metadata.bin"


More information about the Reproducible-builds mailing list