Project

General

Profile

Actions

action #162227

open

[qe-core] Modularize `isotovideo`

Added by chock 9 months ago. Updated 7 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
2024-06-13
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

What?

Our isotovideo module currently has to handle 3 primary responsibilities: Machine/VM provisioning, test environment setup, test scheduling/execution.

This design creates a conflict of interest and makes the module itself harder to maintain.
It also makes changing parts of the backend much more difficult - if not straight up impossible - as the many functionalities of this module
are referenced in many other parts of os-autoinst.

Aside from this it also makes the codebase harder to understand for first time/outside contributors.

A possible solution would be to decouple the three main responsibilities of isotovideo into their own modules with each one having only one or two "public"
functions that are called by something on the outside. Everything else regarding this functionality should be handled internally.

For example:
Split isotovideo into a isotomachine module for machine/VM provisioning, testenv module for setting up a test environment and test_run module for the actual
test exeuction/scheduling/etc. All of these have only one function that a test_master module could call. test_master takes care of ensuring that each step is executed
at the right point in time, dispatching the other modules to do their thing, and handling any information or errors they may return and passing them on to the relevant
recipients.
Each module itself (isotomachine, testenv and test_runner respectively) would only be responsible for their defined roles not caring for or depending on the other modules.

An approach like this would help modularize os-autoinst and make it easier to change the way it operates without needing to tear too many links apart. It would also allow developers to completely swap modules for their own implementations as long as they provide this one public function that the test_master would call.

Goals

The goal of this change is to ease maintenance by decoupling and consolidating unrelated functionality into strictly separated modules which can easily be rewritten or replaced without major changes to the rest of the code.
As an additional benefit it would make the code be clearer and easier to understand for newcomers or outside contributors as the responsibility of each module is clear.

Progress

I have created a development board for the GitHub repository to track progress.

As of August 15th, 2024, the library isototest - supposed to handle test scheduling and execution - has now fully functional VNC connection including typing and receiving screenshots of the remote machine. (English alphabet and special characters only currently.)
Logging has also been implemented for all three libraries, offering a sample implementation of formatted log entries for trace, debug, info, warning and error log levels.


Checklist

  • Create master module to handle invocation of the correct action at the correct time as well as information handling
  • Split VM/machine setup, testenv and test execution into separate modules
  • Have all returns (including exceptions) "bubble" to the master module and be handled there
  • Each module must only have one public "interface" function where applicable. Everything else should be handled internally by the module.
Actions #1

Updated by szarate 9 months ago

  • Tags set to platform-team
Actions #2

Updated by szarate 8 months ago

a small vm is running for now in qamaster:

  • qamaster.qe.nue2.suse.org:14889

  • I'm running it with: qemu-system-x86_64 -enable-kvm -cpu host -m 512m -serial mon:stdio -nographic -vnc :8989 -drive file=openSUSE-MicroOS.x86_64-kvm-and-xen.qcow2

Actions #3

Updated by szarate 8 months ago

  • Tags changed from platform-team to platform-team, openqa-rust
Actions #5

Updated by chock 8 months ago

  • Description updated (diff)
  • Assignee set to chock

szarate wrote in #note-4:

@chock has started with https://github.com/ByteOtter/isotest-ng

You can find current issues and progress here: https://github.com/ByteOtter/projects/5

Actions #6

Updated by chock 7 months ago

  • Description updated (diff)
Actions

Also available in: Atom PDF