public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 2/4] testsuite: fallback to diff in compare_repro_image if diffoscope is missing
Date: Fri, 21 Aug 2026 11:40:36 +0200	[thread overview]
Message-ID: <20260821094038.1816837-2-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20260821094038.1816837-1-felix.moessbauer@siemens.com>

When running the test in the container, diffoscope is missing. This is
not a test failure, but just makes the output less helpful in case the
artifacts are not identical.

To still be able to get the binary result of the test, we just fall back
to a hash comparison, using diff -q.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 testsuite/repro-build-test.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/testsuite/repro-build-test.py b/testsuite/repro-build-test.py
index c1b51aff..eb2cb3b1 100755
--- a/testsuite/repro-build-test.py
+++ b/testsuite/repro-build-test.py
@@ -1,5 +1,7 @@
 #!/usr/bin/env python3
 
+import shutil
+
 from cibuilder import CIBuilder
 from utils import CIUtils
 from avocado.utils import process
@@ -68,8 +70,13 @@ class ReproBuild(CIBuilder):
         self.log.info(
             "Compare artifacts image1: " + image1 + ", image2: " + image2
         )
+
+        compare_cmd = "diff -q"
+        if shutil.which('diffoscope'):
+            compare_cmd = \
+                f"diffoscope --text {self.build_dir}/diffoscope-output.txt"
         result = process.run(
-            f"diffoscope --text {self.build_dir}/diffoscope-output.txt"
+            f"{compare_cmd}"
             f" {self.build_dir}/{image1} {self.build_dir}/{image2}",
             ignore_status=True,
         )
-- 
2.55.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260821094038.1816837-2-felix.moessbauer%40siemens.com.

  reply	other threads:[~2026-08-21  9:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  9:40 [PATCH 1/4] testsuite: allow to run all tests below testsuite in container 'Felix Moessbauer' via isar-users
2026-08-21  9:40 ` 'Felix Moessbauer' via isar-users [this message]
2026-08-21  9:40 ` [PATCH 3/4] testsuite: make repro test image type agnostic 'Felix Moessbauer' via isar-users
2026-08-21  9:40 ` [PATCH 4/4] testsuite: check if python cache is deleted or reproducible 'Felix Moessbauer' via isar-users
2026-08-31  9:27 ` [PATCH 1/4] testsuite: allow to run all tests below testsuite in container Zhihang Wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260821094038.1816837-2-felix.moessbauer@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=felix.moessbauer@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox