public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: libabigail@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>, Dodji Seketeli <dodji@redhat.com>,
	Thomas Schwinge <thomas@codesourcery.com>
Subject: [PATCH] fedabipkgdiff: Enable testing without proper Koji installation
Date: Fri, 17 Dec 2021 23:16:26 +0100	[thread overview]
Message-ID: <20211217221626.2540912-1-thomas@codesourcery.com> (raw)

... as is now documented in 'CONTRIBUTING'.

	* tools/fedabipkgdiff: Handle 'koji.ConfigurationError'.
	* configure.ac: Likewise.
	* CONTRIBUTING: Document "fedabipkgdiff testing".

Documenting/providing a way to enable such testing, this commit can be
considered a sequel to commit 90d236a03343d75ea504d53c73270e50b9000e75
"Bug 22076 - Disable fedabipkgdiff for old koji clients", for Mark Wielaard's
PR22076 "runtestfedabipkgdiff.py fails on debian-amd64".

Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
---
 CONTRIBUTING        | 20 ++++++++++++++++++++
 configure.ac        |  6 +++++-
 tools/fedabipkgdiff | 17 ++++++++++++++---
 3 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/CONTRIBUTING b/CONTRIBUTING
index 24a483b2..5ab7bcce 100644
--- a/CONTRIBUTING
+++ b/CONTRIBUTING
@@ -174,6 +174,26 @@ make sure to add your new test input files to the
 tests/data/Makefile.am file, in the EXTRA_DIST variable.  Look at how
 things are organized in that file, and please do things similarly.
 
+fedabipkgdiff testing
+---------------------
+
+This depends on the Python koji and a few support modules.  If these are
+not available, 'configure' disables fedabipkgdiff and its 'make check'
+testing.
+
+Debian and Ubuntu, for example, don't provide packages for the Python
+koji module.  If you'd like to run fedabipkgdiff testing without manually
+doing a proper Koji installation, you may simply download Koji sources
+(<https://pagure.io/koji>, releases, or Git clone) and point to these via
+the Python search path.  For example, tested 2021-12-11:
+
+  wget https://pagure.io/koji/archive/koji-1.27.0/koji-koji-1.27.0.tar.gz
+  tar -xzf koji-koji-1.27.0.tar.gz
+  export PYTHONPATH="$PWD"/koji-koji-1.27.0
+
+A libabigail 'configure' run then enables fedabipkgdiff and its
+'make check' testing.
+
 Coding language and style
 ==========================
 
diff --git a/configure.ac b/configure.ac
index 40f57ed9..29130175 100644
--- a/configure.ac
+++ b/configure.ac
@@ -588,7 +588,11 @@ if test x$CHECK_DEPS_FOR_FEDABIPKGDIFF = xyes; then
     AC_MSG_CHECKING([if koji client is recent enough])
     $PYTHON 2>&AS_MESSAGE_LOG_FD -c "
 import koji
-koji.read_config('koji')"
+try:
+    koji.read_config('koji')
+except koji.ConfigurationError:
+    # See 'tools/fedabipkgdiff'.
+    pass"
     if test $? -eq 0; then
       koji_version_check_ok=yes
     else
diff --git a/tools/fedabipkgdiff b/tools/fedabipkgdiff
index 89cbd15c..be4182b2 100755
--- a/tools/fedabipkgdiff
+++ b/tools/fedabipkgdiff
@@ -46,9 +46,20 @@ import koji
 # something wrong.
 
 
-koji_config = koji.read_config('koji')
-DEFAULT_KOJI_SERVER = koji_config['server']
-DEFAULT_KOJI_TOPURL = koji_config['topurl']
+# First, try proper Koji initialization.
+try:
+    koji_config = koji.read_config('koji')
+    DEFAULT_KOJI_SERVER = koji_config['server']
+    DEFAULT_KOJI_TOPURL = koji_config['topurl']
+except koji.ConfigurationError:
+    # ..., but if that fails because of a rather strict interpretation where
+    # 'read_config' looks for configuration files, just use dummy values.
+    # These fail upon use unless overridden, which for libabigail test suite
+    # usage they always are (all relevant artifacts are shipped in the
+    # libabigail distribution).
+    DEFAULT_KOJI_SERVER = 'dummy_DEFAULT_KOJI_SERVER'
+    DEFAULT_KOJI_TOPURL = 'dummy_DEFAULT_KOJI_TOPURL'
+
 
 # The working directory where to hold all data including downloaded RPM
 # packages Currently, it's not configurable and hardcode here. In the future
-- 
2.25.1


             reply	other threads:[~2021-12-17 22:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 22:16 Thomas Schwinge [this message]
2021-12-20 16:41 ` Dodji Seketeli

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=20211217221626.2540912-1-thomas@codesourcery.com \
    --to=thomas@codesourcery.com \
    --cc=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    --cc=mark@klomp.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).