Skip to content

Commit

Permalink
Adjust avc check setup and fix docs generation (#3373)
Browse files Browse the repository at this point in the history
* Allow individual tests set their `avc` checks as needed

Let's go the other way round: Enable the check by default, allow
individual tests to set it according to their needs by a simple
definition and disable it globally when not initiated by packit.

* Explore all available plugins when generating docs

We also need test checks and who knows what else in the future as
well. So let's just explore them all.
  • Loading branch information
psss authored Nov 21, 2024
1 parent e7cf41d commit 44cb172
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/scripts/generate-stories.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def main() -> None:
logger = tmt.Logger.create()
logger.add_console_handler()

# Explore available *export* plugins - do not import other plugins, we don't need them.
tmt.plugins.explore_export_package(logger)
# Explore available plugins
tmt.plugins.explore(logger)

# Generate stories
tree = tmt.Tree(logger=logger, path=Path.cwd())
Expand Down
8 changes: 6 additions & 2 deletions tests/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ framework: beakerlib
contact: Petr Šplíchal <[email protected]>
tier: 2
require: [tmt]
check: [avc]
duration: 10m
environment:
TMT_FEELING_SAFE: 1

adjust:
- check: [avc]
when: initiator == packit
- check: []
when: initiator is not defined or initiator != packit
because:
we don't want to run the avc check for local testing as it
needs root and we're executing tests under a regular user
8 changes: 0 additions & 8 deletions tmt/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,6 @@ def import_member(
return (imported, getattr(imported, member))


# Small helper for one specific package - export plugins are needed when
# generating docs.
def explore_export_package(logger: Logger) -> None:
""" Import all plugins bundled into tmt.export package """

_explore_package('tmt.export', _TMT_ROOT / 'export', logger.descend())


RegisterableT = TypeVar('RegisterableT')


Expand Down

0 comments on commit 44cb172

Please sign in to comment.