From 8d4f2107c461d1aeecf1c538823afb6ba2f82e0c141cf4c31001975c90d1c63f Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 12 Mar 2021 08:04:12 +0000 Subject: [PATCH 1/3] - Disable failing tests explicitly instead of ignoring the exit code. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/diffoscope?expand=0&rev=10 --- diffoscope.changes | 5 +++++ diffoscope.spec | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/diffoscope.changes b/diffoscope.changes index b6e91a3..faf5b7a 100644 --- a/diffoscope.changes +++ b/diffoscope.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 12 08:03:39 UTC 2021 - Sebastian Wagner + +- Disable failing tests explicitly instead of ignoring the exit code. + ------------------------------------------------------------------- Sat Feb 27 15:00:17 UTC 2021 - Sebastian Wagner diff --git a/diffoscope.spec b/diffoscope.spec index 30ec532..b900ebc 100644 --- a/diffoscope.spec +++ b/diffoscope.spec @@ -134,8 +134,10 @@ if [ "$1" = 0 ] ; then fi %check -# 3 tests fail 177 skipped due to missing tools, needs more investigation -py.test-%{python3_bin_suffix} -v || : +# test_difference: https://bugzilla.opensuse.org/show_bug.cgi?id=1183143 (https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/243) +# test_libmix_differences https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/244#note_231513 +# test_identification https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/98 +py.test-%{python3_bin_suffix} -k 'not test_difference and not test_identification and not test_libmix_differences' %files %doc README.rst From 88f4b01d496b2abafdd9f08fbfa6f4ae445741db6477a8ec112819a4b928dedf Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Mon, 15 Mar 2021 21:09:23 +0000 Subject: [PATCH 2/3] - activate test_differences test, as it is fixed in openSUSE TW. - use fix-tests-libmix_differences.patch based on upstream patch and activate test_limix_differences tests. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/diffoscope?expand=0&rev=11 --- diffoscope.changes | 6 ++++ diffoscope.spec | 7 +++-- fix-tests-libmix_differences.patch | 47 ++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 fix-tests-libmix_differences.patch diff --git a/diffoscope.changes b/diffoscope.changes index faf5b7a..a08b8a7 100644 --- a/diffoscope.changes +++ b/diffoscope.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 15 21:08:35 UTC 2021 - Sebastian Wagner + +- activate test_differences test, as it is fixed in openSUSE TW. +- use fix-tests-libmix_differences.patch based on upstream patch and activate test_limix_differences tests. + ------------------------------------------------------------------- Fri Mar 12 08:03:39 UTC 2021 - Sebastian Wagner diff --git a/diffoscope.spec b/diffoscope.spec index b900ebc..badeb8b 100644 --- a/diffoscope.spec +++ b/diffoscope.spec @@ -26,6 +26,8 @@ URL: https://diffoscope.org/ Source0: https://diffoscope.org/archive/diffoscope-%{version}.tar.bz2 Source1: https://diffoscope.org/archive/diffoscope-%{version}.tar.bz2.asc Source2: diffoscope.keyring +# PATCH-FIX-UPSTREAM fix-tests-libmix_differences.patch -- fixes test_libmix_differences after https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/244 https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/fda75c731cd20383b15bcfc3326100b5ecd0787f.diff +Patch0: fix-tests-libmix_differences.patch BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-base >= 3.7 @@ -112,6 +114,7 @@ debbindiff. %prep %setup -q sed -i '0,/#!\/usr\/bin\/env/ d' diffoscope/main.py +%patch0 -p1 %build %python3_build @@ -134,10 +137,8 @@ if [ "$1" = 0 ] ; then fi %check -# test_difference: https://bugzilla.opensuse.org/show_bug.cgi?id=1183143 (https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/243) -# test_libmix_differences https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/244#note_231513 # test_identification https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/98 -py.test-%{python3_bin_suffix} -k 'not test_difference and not test_identification and not test_libmix_differences' +py.test-%{python3_bin_suffix} -k 'not test_identification' %files %doc README.rst diff --git a/fix-tests-libmix_differences.patch b/fix-tests-libmix_differences.patch new file mode 100644 index 0000000..42ee7a7 --- /dev/null +++ b/fix-tests-libmix_differences.patch @@ -0,0 +1,47 @@ +diff --git a/tests/comparators/test_elf.py b/tests/comparators/test_elf.py +index 5e3658a5afff98f01f23aa0716b49229840890b4..82396313f450676d21bcd774396376435e24f57d 100644 +--- a/tests/comparators/test_elf.py ++++ b/tests/comparators/test_elf.py +@@ -182,15 +182,22 @@ def test_libmix_differences(libmix_differences): + x86_o = x86_o.details[0] + assert x86_o.source1.startswith("objdump ") + assert src_c.source1.endswith(".c") +- x_obj = x_obj.details[0] +- assert x_obj.source1.startswith("readelf ") + + # Content + assert "return42_or_3" in file_list.unified_diff + assert_diff(mach_o, "elfmix_mach_o_expected_diff") + assert_diff(x86_o, "elfmix_disassembly_expected_diff") + assert_diff(src_c, "elfmix_src_c_expected_diff") +- assert_diff(x_obj, "elfmix_x_obj_expected_diff") ++ ++ x_obj = x_obj.details[0] ++ if x_obj.source1.startswith("readelf "): ++ assert_diff(x_obj, "elfmix_x_obj_expected_diff") ++ elif x_obj.source1.startswith("objdump "): ++ assert_diff(x_obj, "elfmix_x_obj_objdump_expected_diff") ++ else: ++ pytest.fail( ++ f"x_obj is neither readelf or objdump: {repr(x_obj.source1)}" ++ ) + + + TEST_DBGSYM_DEB1_PATH = data("dbgsym/add/test-dbgsym_1_amd64.deb") +diff --git a/tests/data/elfmix_x_obj_objdump_expected_diff b/tests/data/elfmix_x_obj_objdump_expected_diff +new file mode 100644 +index 0000000000000000000000000000000000000000..1c0aace4c3be236262808f8d87336fcb68c3ec3e +--- /dev/null ++++ b/tests/data/elfmix_x_obj_objdump_expected_diff +@@ -0,0 +1,11 @@ ++@@ -3,9 +3,9 @@ ++ ++ Disassembly of section .text: ++ ++ 00000000 : ++ return42_or_3(): ++ entry a1, 32 ++ mov.n a7, a1 ++- movi.n a2, 42 +++ movi.n a2, 43 ++ retw.n From 5eef8c298044c53903faef6e1cceb9b3651e4a5a56e58f045767474a5b57bfda Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Tue, 16 Mar 2021 10:47:17 +0000 Subject: [PATCH 3/3] - add fix-tests-libmix_differences-2.patch to fix a newline in the other upstream patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/diffoscope?expand=0&rev=12 --- diffoscope.changes | 5 +++++ diffoscope.spec | 7 +++++-- fix-tests-libmix_differences-2.patch | 9 +++++++++ fix-tests-libmix_differences.patch | 3 ++- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 fix-tests-libmix_differences-2.patch diff --git a/diffoscope.changes b/diffoscope.changes index a08b8a7..744d7b4 100644 --- a/diffoscope.changes +++ b/diffoscope.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Mar 16 09:20:53 UTC 2021 - Sebastian Wagner + +- add fix-tests-libmix_differences-2.patch to fix a newline in the other upstream patch + ------------------------------------------------------------------- Mon Mar 15 21:08:35 UTC 2021 - Sebastian Wagner diff --git a/diffoscope.spec b/diffoscope.spec index badeb8b..d37b1b9 100644 --- a/diffoscope.spec +++ b/diffoscope.spec @@ -26,8 +26,10 @@ URL: https://diffoscope.org/ Source0: https://diffoscope.org/archive/diffoscope-%{version}.tar.bz2 Source1: https://diffoscope.org/archive/diffoscope-%{version}.tar.bz2.asc Source2: diffoscope.keyring -# PATCH-FIX-UPSTREAM fix-tests-libmix_differences.patch -- fixes test_libmix_differences after https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/244 https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/fda75c731cd20383b15bcfc3326100b5ecd0787f.diff -Patch0: fix-tests-libmix_differences.patch +# PATCH-FIX-UPSTREAM fix-tests-libmix_differences.patch -- fixes test_libmix_differences https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/244 +Patch0: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/fda75c731cd20383b15bcfc3326100b5ecd0787f.diff#/fix-tests-libmix_differences.patch +# PATCH-FIX-UPSTREAM fix-tests-libmix_differences-2.patch -- fixes test_libmix_differences https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/244 +Patch1: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/27e27436ffad4ef35c2bde751001bef647c12caf.diff#/fix-tests-libmix_differences-2.patch BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-base >= 3.7 @@ -115,6 +117,7 @@ debbindiff. %setup -q sed -i '0,/#!\/usr\/bin\/env/ d' diffoscope/main.py %patch0 -p1 +%patch1 -p1 %build %python3_build diff --git a/fix-tests-libmix_differences-2.patch b/fix-tests-libmix_differences-2.patch new file mode 100644 index 0000000..04a66cd --- /dev/null +++ b/fix-tests-libmix_differences-2.patch @@ -0,0 +1,9 @@ +diff --git a/tests/data/elfmix_x_obj_objdump_expected_diff b/tests/data/elfmix_x_obj_objdump_expected_diff +index 1c0aace4c3be236262808f8d87336fcb68c3ec3e..e36b59703d1231667e6609a2f5e4b9264adc09be 100644 +--- a/tests/data/elfmix_x_obj_objdump_expected_diff ++++ b/tests/data/elfmix_x_obj_objdump_expected_diff +@@ -9,4 +9,3 @@ + - movi.n a2, 42 + + movi.n a2, 43 + retw.n +- diff --git a/fix-tests-libmix_differences.patch b/fix-tests-libmix_differences.patch index 42ee7a7..bea0da4 100644 --- a/fix-tests-libmix_differences.patch +++ b/fix-tests-libmix_differences.patch @@ -33,7 +33,7 @@ new file mode 100644 index 0000000000000000000000000000000000000000..1c0aace4c3be236262808f8d87336fcb68c3ec3e --- /dev/null +++ b/tests/data/elfmix_x_obj_objdump_expected_diff -@@ -0,0 +1,11 @@ +@@ -0,0 +1,12 @@ +@@ -3,9 +3,9 @@ + + Disassembly of section .text: @@ -45,3 +45,4 @@ index 0000000000000000000000000000000000000000..1c0aace4c3be236262808f8d87336fcb +- movi.n a2, 42 ++ movi.n a2, 43 + retw.n ++