Project

General

Profile

Actions

action #101444

closed

coordination #90086: [epic] Refactor container tests

Move install_podman_when_needed and install_docker_when_needed to engine class.

Added by jlausuch over 2 years ago. Updated over 2 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Target version:
-
Start date:
2021-10-25
Due date:
% Done:

0%

Estimated time:

Description

Currently we have these 2 functions in lib/containers/common.pm:
install_podman_when_needed
install_docker_when_needed

The idea of this ticket is to move this logic to engine.pm, and simply do:
$engine->install()

This way, when we create the object engine via Factory class,

my $engine = $self->containers_factory('podman');

should also install the packages and configure_insecure_registries , so we don't need to do that in the tests every time.

This depends on https://progress.opensuse.org/issues/90086

Actions #1

Updated by jlausuch over 2 years ago

  • Subject changed from Move to Move install_podman_when_needed and install_docker_when_needed to engine class.
Actions #2

Updated by jlausuch over 2 years ago

  • Status changed from New to Blocked
Actions #4

Updated by jlausuch over 2 years ago

  • Description updated (diff)
Actions #5

Updated by jlausuch over 2 years ago

  • Description updated (diff)
Actions #6

Updated by jlausuch over 2 years ago

  • Status changed from Blocked to Workable
Actions #7

Updated by pdostal over 2 years ago

  • Status changed from Workable to In Progress

I am working on this.

Actions #8

Updated by pdostal over 2 years ago

  • Assignee set to pdostal
Actions #9

Updated by ybonatakis over 2 years ago

Engine class is not the proper place for it.
As i have mentioned here the design should not mix interrelated ideas. The Engine should deal with container engine tools. The installation is different topic.

Actions #10

Updated by pdostal over 2 years ago

Now I honestly don't know what to do.

Actions #11

Updated by jlausuch over 2 years ago

As discussed during a call, this might not be the best solution.
Alternative proposals:

  • Leave install_podman_when_needed where it is, so others can use it without creating the engine object, and call to this function in the Factory after creating engine.
  • Leave everything as it is, the test modules are responsible for installing the packages (current situation).
  • Add host_configuration.pm to all the container tests and call the installation of packages ONLY there (remove it from the tests modules).
Actions #12

Updated by pdostal over 2 years ago

jlausuch wrote:

As discussed during a call, this might not be the best solution.
Alternative proposals:

  • Leave install_podman_when_needed where it is, so others can use it without creating the engine object, and call to this function in the Factory after creating engine.
  • Leave everything as it is, the test modules are responsible for installing the packages (current situation).
  • Add host_configuration.pm to all the container tests and call the installation of packages ONLY there (remove it from the tests modules).

I vote for the first approach of calling install_podman_when_needed after creating the engine object.

Actions #13

Updated by jlausuch over 2 years ago

pdostal wrote:

jlausuch wrote:

As discussed during a call, this might not be the best solution.
Alternative proposals:

  • Leave install_podman_when_needed where it is, so others can use it without creating the engine object, and call to this function in the Factory after creating engine.
  • Leave everything as it is, the test modules are responsible for installing the packages (current situation).
  • Add host_configuration.pm to all the container tests and call the installation of packages ONLY there (remove it from the tests modules).

I vote for the first approach of calling install_podman_when_needed after creating the engine object.

Me too. I would go even further and create a init() function for engine Class where we do those calls, and in factory we just do $engine->init(), same as for public cloud.

Actions #14

Updated by ybonatakis over 2 years ago

jlausuch wrote:

As discussed during a call, this might not be the best solution.
Alternative proposals:

Some ideas:

  • Leave install_podman_when_needed where it is, so others can use it without creating the engine object, and call to this function in the Factory after creating engine.
my $engine = $self->containers_factory('podman');
$engine->init();

i think it makes sense to have an init()(or install() if you want) in the containers::basetest. in this case, containers_factory doesnt need to take care of anything else or be modified, and serves one purpose as factory. But as containers::basetest, we can include and provide that logic here.

  • Leave everything as it is, the test modules are responsible for installing the packages (current situation).
  • Add host_configuration.pm to all the container tests and call the installation of packages ONLY there (remove it from the tests modules).

it is an option but i kinda afraid this as it will create module dependencies. it could be used as plan B. if host_configuration.pm is not suitable, we might make another module (container_install.pm)

i have also other things in mind but i think it is a bit more complicated so not to consider at the moment

Actions #15

Updated by jlausuch over 2 years ago

Ok, do we agree for now to leave the install functions where they are and create a function init() in the engines to call those functions?

Actions #16

Updated by pdostal over 2 years ago

jlausuch wrote:

Ok, do we agree for now to leave the install functions where they are and create a function init() in the engines to call those functions?

Yes.

Actions #17

Updated by jlausuch over 2 years ago

  • Status changed from In Progress to Rejected

I am rejecting this ticket as discussed.

Actions #18

Updated by jlausuch over 2 years ago

created this ticket for it

Actions

Also available in: Atom PDF