Various phases: consistent format of failure message

composetracker expects the failure message to be in a specific
form, but some phases weren't using it. They were phrasing it
slightly differently, which throws off composetracker's parsing.
We could extend composetracker to handle both forms, but it seems
simpler to just make all the phases use a consistent form.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
(cherry picked from commit 9f8377abab)
This commit is contained in:
Adam Williamson 2024-03-12 08:18:52 -07:00 committed by Stepan Oksanichenko
parent 2bf6c216bc
commit ee8a56e64d
Signed by: soksanichenko
GPG Key ID: AB9983172AB1E45B
6 changed files with 6 additions and 6 deletions

View File

@ -76,7 +76,7 @@ class ImageContainerThread(WorkerThread):
)
if koji.watch_task(task_id, log_file) != 0:
raise RuntimeError(
"ImageContainer: task %s failed: see %s for details"
"ImageContainer task failed: %s. See %s for details"
% (task_id, log_file)
)

View File

@ -148,7 +148,7 @@ class RunKiwiBuildThread(WorkerThread):
)
if koji.watch_task(task_id, log_file) != 0:
raise RuntimeError(
"kiwiBuild: task %s failed: see %s for details" % (task_id, log_file)
"kiwiBuild task failed: %s. See %s for details" % (task_id, log_file)
)
# Refresh koji session which may have timed out while the task was

View File

@ -134,7 +134,7 @@ class OSBSThread(WorkerThread):
# though there is not much there).
if koji.watch_task(task_id, log_file) != 0:
raise RuntimeError(
"OSBS: task %s failed: see %s for details" % (task_id, log_file)
"OSBS task failed: %s. See %s for details" % (task_id, log_file)
)
scratch = config.get("scratch", False)

View File

@ -185,7 +185,7 @@ class RunOSBuildThread(WorkerThread):
)
if koji.watch_task(task_id, log_file) != 0:
raise RuntimeError(
"OSBuild: task %s failed: see %s for details" % (task_id, log_file)
"OSBuild task failed: %s. See %s for details" % (task_id, log_file)
)
# Refresh koji session which may have timed out while the task was

View File

@ -227,7 +227,7 @@ class ImageContainerThreadTest(helpers.PungiTestCase):
(self.compose, self.compose.variants["Server"], self.cfg.copy()), 1
)
self.assertRegex(str(ctx.exception), r"task 12345 failed: see .+ for details")
self.assertRegex(str(ctx.exception), r"task failed: 12345. See .+ for details")
self.assertRepoFile()
self.assertKojiCalls(self.cfg)
self.assertEqual(add_metadata.call_args_list, [])

View File

@ -576,7 +576,7 @@ class OSBSThreadTest(helpers.PungiTestCase):
with self.assertRaises(RuntimeError) as ctx:
self.t.process((self.compose, self.compose.variants["Server"], cfg), 1)
self.assertRegex(str(ctx.exception), r"task 12345 failed: see .+ for details")
self.assertRegex(str(ctx.exception), r"task failed: 12345. See .+ for details")
@mock.patch("pungi.phases.osbs.get_file_from_scm")
@mock.patch("pungi.phases.osbs.kojiwrapper.KojiWrapper")