Skip to content

Handle test framework dependencies in required packages#4802

Open
psss wants to merge 1 commit intomainfrom
psss-beakerlib-test-requires
Open

Handle test framework dependencies in required packages#4802
psss wants to merge 1 commit intomainfrom
psss-beakerlib-test-requires

Conversation

@psss
Copy link
Copy Markdown
Member

@psss psss commented Apr 15, 2026

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.

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • include a release note

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.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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,
                )

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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • Nit: Can move the snippet next to the collected_requires?
  • What about the checks?

@psss psss added the step | execute Stuff related to the execute step label Apr 15, 2026
@psss psss added this to planning Apr 15, 2026
@github-project-automation github-project-automation bot moved this to backlog in planning Apr 15, 2026
@psss
Copy link
Copy Markdown
Member Author

psss commented Apr 15, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

step | execute Stuff related to the execute step

Projects

Status: backlog

Development

Successfully merging this pull request may close these issues.

Unable to find beakerlib error in centos-stream-9

2 participants