Actions
action #107230
closedcoordination #90086: [epic] Refactor container tests
Streamline RunArgs
Start date:
2022-02-22
Due date:
% Done:
0%
Estimated time:
Tags:
Description
In containers, we use RunArgs to provide the runtime to the test module.
The problem is we create RunArgs in multiple locations. Example:
sub load_image_test {
my ($runtime) = @_;
my $args = OpenQA::Test::RunArgs->new();
$args->{runtime} = $runtime;
loadtest('containers/image', run_args => $args, name => "image_$runtime");
}
sub load_3rd_party_image_test {
my ($runtime) = @_;
my $args = OpenQA::Test::RunArgs->new();
$args->{runtime} = $runtime;
loadtest('containers/third_party_images', run_args => $args, name => $runtime . "_3rd_party_images");
}
There are scenarios where we call both mentioned subroutines, e.g:
load_image_test('podman');
load_3rd_party_image_test('podman');
It would be better to pass the same RunArgs to both subroutines, like:
my $args = OpenQA::Test::RunArgs->new();
$args->{runtime} = 'podman';
load_image_test($args);
load_3rd_party_image_test($args);
The implementation may of course be different.
Actions