Skip to content
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

Include an example template for creating tmt tests #2754

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

psss
Copy link
Collaborator

@psss psss commented Mar 12, 2024

Vast majority of tests verifying the tmt features shares a similar outline of the beakerlib skeleton. Let's make it super easy to start writing a new tmt test. The skeleton also covers submitting log.txt when something goes wrong during the test execution so that a detailed investigation is possible later.

Pull Request Checklist

  • write the documentation
  • include a release note

@psss
Copy link
Collaborator Author

psss commented Mar 12, 2024

Related to the discussion in #2744.

@psss psss added the documentation Improvements or additions to documentation label Mar 12, 2024
Vast majority of tests verifying the `tmt` features shares a
similar outline of the `beakerlib` skeleton. Let's make it super
easy to start writing a new `tmt` test. The skeleton also covers
submitting `log.txt` when something goes wrong during the test
execution so that a detailed investigation is possible later.
@LecrisUT
Copy link
Contributor

This is about how to expand tmt init?

PS: with beakerlib+homebrew, we might want to rethink how to source beakerlib.sh

@lukaszachy
Copy link
Collaborator

PS: with beakerlib+homebrew, we might want to rethink how to source beakerlib.sh

Could you explain a bit?

Copy link
Collaborator

Choose a reason for hiding this comment

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

framework: beakerlib is missing

==================================================================

When creating a new ``tmt`` test it is recommended to use the test
template provided in this directory. In order to be able to use it
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about a link to https://tmt.readthedocs.io/en/stable/guide.html#custom-templates ?
Otherwise it is confusing why files are linked as .j2 to some directory which might not yet exist.

@LecrisUT
Copy link
Contributor

PS: with beakerlib+homebrew, we might want to rethink how to source beakerlib.sh

Could you explain a bit?

The issue is about:

source /usr/share/beakerlib/beakerlib.sh

This can't be the install path for beakerlib on homebrew also because on macos and linuxbrew they are different. It needs to be editable, most likely through BEAKERLIB_DIR which tmt provides depending on detected OS

Comment on lines +11 to +12
ln -sr test.sh ~/.config/tmt/templates/script/tmt.j2
ln -sr main.fmf ~/.config/tmt/templates/test/tmt.j2
Copy link
Contributor

Choose a reason for hiding this comment

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

This is using the user-configuration (thought it was still a draft), but for these templates it would make more sense to be on the project level since each project might have slightly different beakerlib scripts. That doesn't seem to be in the spec/stories, and I'm not sure where a project's template files would reside. The only place I can think of would be path/to/fmf_root/.fmf/templates/

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

Successfully merging this pull request may close these issues.

None yet

3 participants