Skip to content

Commit 44cb172

Browse files
authored
Adjust avc check setup and fix docs generation (#3373)
* 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.
1 parent e7cf41d commit 44cb172

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

docs/scripts/generate-stories.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def main() -> None:
5353
logger = tmt.Logger.create()
5454
logger.add_console_handler()
5555

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

5959
# Generate stories
6060
tree = tmt.Tree(logger=logger, path=Path.cwd())

tests/main.fmf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ framework: beakerlib
33
contact: Petr Šplíchal <[email protected]>
44
tier: 2
55
require: [tmt]
6+
check: [avc]
67
duration: 10m
78
environment:
89
TMT_FEELING_SAFE: 1
910

1011
adjust:
11-
- check: [avc]
12-
when: initiator == packit
12+
- check: []
13+
when: initiator is not defined or initiator != packit
14+
because:
15+
we don't want to run the avc check for local testing as it
16+
needs root and we're executing tests under a regular user

tmt/plugins/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,6 @@ def import_member(
293293
return (imported, getattr(imported, member))
294294

295295

296-
# Small helper for one specific package - export plugins are needed when
297-
# generating docs.
298-
def explore_export_package(logger: Logger) -> None:
299-
""" Import all plugins bundled into tmt.export package """
300-
301-
_explore_package('tmt.export', _TMT_ROOT / 'export', logger.descend())
302-
303-
304296
RegisterableT = TypeVar('RegisterableT')
305297

306298

0 commit comments

Comments
 (0)