From 1fdf7cd56737187d85c1f1f2dcf16bb89d240183 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 7 Oct 2020 09:29:18 -0700 Subject: [PATCH] Handle update build not having any packages for target arch openQA sometimes winds up testing an update that doesn't have any packages for x86_64 (or aarch64). The most common case is s390utils, which is on the critpath but only has packages for s390x. I would ideally like to skip scheduling entirely if the update has no packages for the arch we're scheduling on, but sadly that involves using the Koji API which is XML-RPC and I don't really want to deal with that again. This deals with it at the test level instead, by checking the error message if `koji download-build` fails and carrying on if it's the "no packages for this arch" error. That means if the update has no packages at all for our arch we're not really testing anything, but that's better than a bunch of false failures, I guess. Signed-off-by: Adam Williamson --- lib/utils.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/utils.pm b/lib/utils.pm index 3f1034c0..e047f24c 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -543,7 +543,13 @@ sub _repo_setup_updates { if (get_var("ADVISORY_NVRS")) { # regular update case foreach my $nvr (split(/ /, get_var("ADVISORY_NVRS"))) { - assert_script_run "koji download-build --arch=" . get_var("ARCH") . " --arch=noarch $nvr", 600; + if (script_run "koji download-build --arch=" . get_var("ARCH") . " --arch=noarch $nvr 2> download.log", 600) { + # if the error was because the build has no packages + # for our arch, that's okay, skip it. otherwise, die + if (script_run "grep 'No .*available for $nvr' download.log") { + die "koji download-build failed!"; + } + } } } elsif (get_var("KOJITASK")) {