Handle test framework dependencies in required packages#4802
Open
Handle test framework dependencies in required packages#4802
Conversation
Instead of installing test framework dependencies during the essential requires, let's handle them under the required packages as they are not needed before the actual test execution. This prevents having to provide an explicit `order` when enabling the `epel` repository on `centos-stream` to run `beakerlib` tests. Fix #4796.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the prepare step to use collected_requires instead of collected_essential_requires for test framework requirements. Use tmt.base.core.assert_simple_dependencies to ensure requirements are simple dependencies and to provide better error messages.
Comment on lines
+282
to
+284
| collected_requires[guest].dependencies += test.test_framework.get_requirements( | ||
| test, self._logger | ||
| ) |
Contributor
There was a problem hiding this comment.
Use tmt.base.core.assert_simple_dependencies to ensure that test framework requirements are simple dependencies, maintaining consistency with how test.require and test.recommend are handled in the same loop. This also provides a more descriptive error message if a non-simple dependency is encountered.
collected_requires[guest].dependencies += tmt.base.core.assert_simple_dependencies(
test.test_framework.get_requirements(test, self._logger),
'After beakerlib processing, tests may have only simple requirements',
self._logger,
)
LecrisUT
reviewed
Apr 15, 2026
Comment on lines
-282
to
289
| collected_essential_requires[ | ||
| guest | ||
| ].dependencies += test.test_framework.get_requirements(test, self._logger) | ||
| collected_requires[guest].dependencies += test.test_framework.get_requirements( | ||
| test, self._logger | ||
| ) | ||
|
|
||
| for check in test.check: | ||
| collected_essential_requires[ | ||
| guest | ||
| ].dependencies += check.plugin.essential_requires(guest, test, self._logger) |
Member
There was a problem hiding this comment.
- Nit: Can move the snippet next to the
collected_requires? - What about the checks?
Member
Author
|
Simple plan and test to verify: /plan:
discover:
how: fmf
provision:
how: container
image: centos:stream9
prepare:
how: feature
epel: enabled
execute:
how: tmt
/test:
test: . /usr/share/beakerlib/beakerlib.sh && rlJournalStart && rlJournalEnd
framework: beakerlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of installing test framework dependencies during the essential requires, let's handle them under the required packages as they are not needed before the actual test execution. This prevents having to provide an explicit
orderwhen enabling theepelrepository oncentos-streamto runbeakerlibtests.Fix #4796.
Pull Request Checklist