From 19da83c6cf2bd9c34fe2e265c1def40f054cc928 Mon Sep 17 00:00:00 2001 From: Jan Baier Date: Thu, 7 Dec 2023 16:54:58 +0100 Subject: [PATCH] Parse error messages from scheduling failures openqa-cli schedule will only fail if there is error key in the json root. In our case, the error message is inside the failed job list. Make openqa-cli fail on that as well. Reference: https://progress.opensuse.org/issues/138203 --- lib/OpenQA/CLI/schedule.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenQA/CLI/schedule.pm b/lib/OpenQA/CLI/schedule.pm index 8a1a0b68ac8d..e506d1b2ee70 100644 --- a/lib/OpenQA/CLI/schedule.pm +++ b/lib/OpenQA/CLI/schedule.pm @@ -24,7 +24,7 @@ sub _create_jobs ($self, $client, $args, $param_file, $job_ids) { say $job_count == 1 ? '1 job has been created:' : "$job_count jobs have been created:"; say ' - ' . $host_url->clone->path("tests/$_") for @$job_ids; } - return 0 unless my $error = $json->{error}; + return 0 unless my $error = $json->{error} // join("\n", map { $_->{error_message} } @{$json->{failed}}); print STDERR colored(['red'], $error, "\n"); return 1; }