Skip to content

Reduce unnecessary reboots in tests #748

@philipanda

Description

@philipanda

The problem you're addressing (if any)

Tests that are performed on multiple OSes generally perform a lot of unnecesary reboots. Instead of running all little checks on one OS and the moving to another, we are doing a little check on every supporteed OS before moving to another one.

Example: the DSP test suite. The DSP001, DSP002, DSP003 test on one OS can be done in one go. The total execution time would be very close to executing just one of them, because most of the time is wasted on rebooting the platform and the OS.

Describe the solution you'd like

The tests should not perform reboots if it is not necessary.
How to solve this is not straightforward.

Where is the value to a user, and who might that user be?

A significant decrease of tests run time, especially on regressions.

Describe alternatives you've considered

Ideas

  1. The order of executing the tests has to be changed
  • Just swap the test cases in test suites, so that all cases on one OS are next to each other. RF executes cases in
    the order they appear in the .robot file
  • separate tests on different OSes to their own files
    • the test file name when running robot can include a wildcard character, which might make this a good solution
    • scripts/run.sh dasharo-compatibility/network*.robot works and runs network-boot-utilities, network-boot and
      network-speed in one run. Something like scrupts/run.sh dasharo-compatibility/*_201.robot could be used to run
      all tests on 201.
    • There's also the -t flag for robot which allows filtering by test ID
      • scripts/regression.sh -- -t "*.201*" -t "*.202*" -t "*.301" would run all the tests containging .201, .202 or .301 in
        their names allowing for selecting the environments manually
    • the test setup could also just contain a Skip if the OS, for which tests this file contains, is not set as supported in
      config variables
  1. After the order is altered, we need to modify the tests to not reboot if unnecessary
  • Keeping the state of the platform and making the Power On keyword work more like
    Ensure Power On.
    • many tests use Power On as a way to reboot the device. Such cases would need to be fixed. Maybe a
      separate keyword Power Off could be added and used to clearly state when the platform is actually
      rebooted, and when the Power On is used only to ensure it is On.
  • If the tests on different OSes would be separated to their own files, they could be simplified, so that Powering
    On the platform only happens during test suite setup, not on test case basis.
  • If tests on different OSes would stay in one file, a dummy test case could be added before OS change, that
    would perform the reboot and boot the OS used in the following tests.
    • definitely not a pretty solution, could be easy to implement, not so much to use later
  1. What about running tests on all supported OSes
  • Seperating the tests into files for every OS might require the tester to always choose them manually. Right now the
    supported OSes are stored in platform-configs.

Sub-issues

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions