Skip to content

Introduce lib/common.robot and update contributing rules #690

@SebastianCzapla

Description

@SebastianCzapla

The problem you're addressing (if any)

There exists variety of code duplicates, as well as bunch of TODO's in many of OSFV test suites, like this one:

Image
(and recent related issue here: #689)

There is ongoing effort to migrate parts of keywords.robot to lib/ directory, while organizing them by the domain they refer to, like lib/network.robot, lib/tpm.robot. There is also unavoidable set of settings and keywords used in all test suites, SSH imports, OS libraries and so on. In addition, suite setup always includes running Prepare Test Suite keyword, as well as checking a flag if a suite should run or not.

Describe the solution you'd like

Introduce a lib/common.robot that contains settings, keywords and variables present in all testing suites.
This could include:
Libraries: Operating System, Collections, Process, String, RequestLibrary, SSHLibrary, as well as variables.robot, keywords.robot and keys.robot

Keywords:
Power On Default (Move from platform-configs/default.robot, this way it holds only variables and no keywords)
Power Cycle Into Ubuntu - new keyword, many tests repeat the same 3 keywords to boot, find disk and boot
Power Cycle Into Windows - new keyword, the same case as above

Enforce Suite Initialization and Teardown into keywords local to a suite:
Such local keyword can better abstract, a process which sometimes is much more complex than loading variables, which may lead to cross-suite dependencies and contamination, which can break testing in random ways (#673)

There is probably more keywords that could qualify as common, and could easily be moved from keywords.robot into common.robot, making future cleanup efforts easier.

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

Easier implementation of new suite, header size reduction from 20-30 lines to 7-10 lines per suite, less code that works in undocumented way.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    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