Skip to content

Commit

Permalink
Merge pull request #211 from os-autoinst/docker
Browse files Browse the repository at this point in the history
Handle docker build failures
  • Loading branch information
mergify[bot] authored Sep 20, 2024
2 parents 0b26439 + 0359994 commit dad760b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/containers/build.pm
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
use Mojo::Base 'openQAcoretest';
use Mojo::Base 'openQAcoretest', -signatures;
use testapi;

sub run {
# The maximum of the retry is 3810 seconds
assert_script_run('retry -s 30 -r 7 -e -- git clone https://github.com/os-autoinst/openQA.git', timeout => 4000);
assert_script_run("retry -s 30 -r 7 -e -- docker build openQA/container/$_ -t openqa_$_", timeout => 4000) for qw(webui worker);
assert_script_run('retry -s 30 -r 7 -e -- docker build openQA/container/openqa_data -t openqa_data', timeout => 4000);
assert_script_run("retry -s 30 -r 7 -e -- bash -o pipefail -c 'docker build openQA/container/$_ -t openqa_$_ --progress=plain 2>&1 | tee docker_build.txt'", timeout => 4000) for qw(webui worker);
assert_script_run("retry -s 30 -r 7 -e -- bash -o pipefail -c 'docker build openQA/container/openqa_data -t openqa_data --progress=plain 2>&1 | tee docker_build.txt'", timeout => 4000);
}

sub post_fail_hook ($self) {
save_screenshot;
upload_logs 'docker_build.txt';
my $log = script_output('cat docker_build.txt');
record_info('docker build', $log, result => 'fail');
record_info('poo#165992', 'Valid metadata not found at specified URL: https://progress.opensuse.org/issues/165992', result => 'fail')
if $log =~ m/Valid metadata not found at specified URL/;
$self->SUPER::post_fail_hook;
}

1;

0 comments on commit dad760b

Please sign in to comment.