Skip to content

PoC of running granular tests inside #1447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jscotka
Copy link

@jscotka jscotka commented Jul 11, 2025

Test metadata convertor from tests to TMT format
Run each test separately via TMT

  • regenerate TMT metadata for tests: python3 scripts/tmt_test_metadata_extractor.py
  • run plan tmt -vvd run plan --name granular

@click.option('--delimiter', default="-", help='create tmt test strucure based on delimiter')
@click.option('--kstestdir', default=".", help='position where are located additional functions for rhinstaller tests')
def main(path, extension, metadata, delimiter, kstestdir):
file_list = list_files(path, "*." + extension)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the executable .sh files are tests (the directory structure is in shameful state, we have a jira ticket to move tests to a separate directory).
Example of identifying test files when generating permian test cases:

for filename in os.listdir(kstests_dir):

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, would be better to organize it, but is is not big deal for me right now. yep I'm not checking executable bit. but probably executable bit should not be major factor, as it is passed through container, so we should avoid to use executable bits for tests as possible I think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should fix that but until that I think you should check it when identifying the tests, so that for example post-lib-keyboard.sh (which is a library included in tests) does not get into the main.fmf.

Copy link
Contributor

@rvykydal rvykydal Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the executable .sh files are tests (the directory structure is in shameful state, we have a jira ticket to move tests to a separate directory).

For the reference: https://issues.redhat.com/browse/INSTALLER-3259

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, I'll check for executable bit, to avoid using libraries.

Comment on lines +1 to +4
/tests:
/anabot:
/1:
/x:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity - why all those slashes (on all levels)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these slashes creates FMF file structures https://fmf.readthedocs.io/en/stable/features.html#hierarchy , as this is equvalent to creating dir structure to do same thing as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder about the hardcoded values (guest, boot.iso URL) - those are just some temporary ones used during the development, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right this is more less implementation detail for development right now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed internally with rvykydal, we'd like to retain the definitions (TESTTYPE, test enabled/disabled) within the test scripts as the source of truth. Is my understanding correct that it will remain this way and this extractor script is merely a helper tool to translate the metadata into a form that used by TMT?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, this tool just extract the data from tests and construct FMF/TMT metadata. with extracted data. (in production I can imagine it will be also git commit/push hook to have it up to date)

@jscotka jscotka force-pushed the tmt_poc branch 2 times, most recently from 9c1f4f8 to 944dad9 Compare July 22, 2025 13:20
@rvykydal
Copy link
Contributor

/test-os-variants

@rvykydal
Copy link
Contributor

@jscotka can you please rebase the PR on current main so that we can run ci (required because of recent changes)

@jscotka jscotka force-pushed the tmt_poc branch 2 times, most recently from ad46b73 to 1997a28 Compare July 25, 2025 11:27
@rvykydal
Copy link
Contributor

/test-tmt

@@ -7,7 +7,8 @@

set -eu

BASEDIR=$(dirname $(dirname $(dirname $(realpath $0))))
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
BASEDIR="$(dirname $(dirname $SCRIPT_DIR ))"

Check warning

Code scanning / ShellCheck

SC2046

Quote this to prevent word splitting.
@rvykydal
Copy link
Contributor

/test-os-variants --testtype smoke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants