* [PATCH] fedabipkgdiff: Enable testing without proper Koji installation
@ 2021-12-17 22:16 Thomas Schwinge
2021-12-20 16:41 ` Dodji Seketeli
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Schwinge @ 2021-12-17 22:16 UTC (permalink / raw)
To: libabigail; +Cc: Mark Wielaard, Dodji Seketeli, Thomas Schwinge
... 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fedabipkgdiff: Enable testing without proper Koji installation
2021-12-17 22:16 [PATCH] fedabipkgdiff: Enable testing without proper Koji installation Thomas Schwinge
@ 2021-12-20 16:41 ` Dodji Seketeli
0 siblings, 0 replies; 2+ messages in thread
From: Dodji Seketeli @ 2021-12-20 16:41 UTC (permalink / raw)
To: Thomas Schwinge; +Cc: libabigail, Mark Wielaard, Dodji Seketeli
Thomas Schwinge <thomas@codesourcery.com> a écrit:
[...]
> ... as is now documented in 'CONTRIBUTING'.
>
> * tools/fedabipkgdiff: Handle 'koji.ConfigurationError'.
> * configure.ac: Likewise.
> * CONTRIBUTING: Document "fedabipkgdiff testing".
>
> Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
Applied to master, thanks!
[...]
Cheers,
--
Dodji
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-20 16:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17 22:16 [PATCH] fedabipkgdiff: Enable testing without proper Koji installation Thomas Schwinge
2021-12-20 16:41 ` Dodji Seketeli
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).