docs: Add example for sharing tests across repositories#2
Closed
docs: Add example for sharing tests across repositories#2
Conversation
This commit adds a new subsection to `examples.rst` explaining how to share tests across different repositories using tmt.
mcasquer
pushed a commit
that referenced
this pull request
Sep 16, 2025
…Mode (teemtee#4025) There is a hack which TF uses to exclude packages from installation: ``` prepare: - how: install exclude: - curl-minimal - libcurl-minimal ``` While it is correctly skipped in Package Mode: ``` prepare task #2: default-0 on default-0 how: install prepare task #3... ``` In Image Mode it throws the next error: ``` prepare task #2: default-0 on default-0 how: install package: building container image with dependencies warn: Installation failed, trying again after metadata refresh. package: building container image with dependencies package: switching to new image localhost/tmt/bootc/98d6fbdf-87c5-45d9-9bf2-d57a7ad7a065 package: rebooting to apply new image package: building container image with dependencies fail: Command 'podman build -t localhost/tmt/bootc/71da0589-8b12-4642-a548-8ef063ba2524 -f tmp.sYftMCdBvD/Containerfile /var/ARTIFACTS/work-all-no-buildrootj4t_5bzu/plans/all-no-buildroot/prepare' returned 125. ``` The reason is that the prepare step above doesn't trigger the `install` function of the `BootcEngine`, which leads to an empty `containerfile_directives` of the engine. The patch adds a check to see if `containerfile_directives` is empty and skips the build process completely in that case.
mcasquer
pushed a commit
that referenced
this pull request
Jan 19, 2026
Previously, SUPPORTED_DISTRO_PATTERNS was a
(shared) generator. That breaks use of fips prepare feature in multiple
plans within the same tmt run. Now SUPPORTED_DISTRO_PATTERS is just a
tuple and sharing has no negative effects.
Consider the following plan:
```
# reproducer.fmf
summary: Test plan
prepare:
- name: Enable FIPS mode
how: feature
fips: enabled
execute:
how: tmt
discover:
- how: shell
tests:
- name: sample-test
test: echo 'hello!'
/first:
/second:
```
Previously:
```
❯ tmt run plan --name /plans/reproducer discover provision --how minute --image rhel-10.1 prepare
/var/tmp/tmt/run-001
/plans/reproducer/first
discover
...
provision
....
summary: 1 guest provisioned
prepare
queued push task #1: push to default-0
push task #1: push to default-0
queued prepare task #1: essential-requires on default-0
queued prepare task #2: Enable FIPS mode on default-0
prepare task #1: essential-requires on default-0
how: install
summary: Install essential required packages
name: essential-requires
where: default-0
package: /usr/bin/python3 and /usr/bin/flock
prepare task #2: Enable FIPS mode on default-0
how: feature
name: Enable FIPS mode
Enable FIPS
queued pull task #1: pull from default-0
pull task #1: pull from default-0
summary: 2 preparations applied
/plans/reproducer/second
discover
...
provision
...
summary: 1 guest provisioned
prepare
queued push task #1: push to default-0
push task #1: push to default-0
queued prepare task #1: essential-requires on default-0
queued prepare task #2: Enable FIPS mode on default-0
prepare task #1: essential-requires on default-0
how: install
summary: Install essential required packages
name: essential-requires
where: default-0
package: /usr/bin/python3 and /usr/bin/flock
prepare task #2: Enable FIPS mode on default-0
how: feature
name: Enable FIPS mode
fail: FIPS prepare feature is supported on RHEL/CentOS-Stream 8, 9 or 10.
plan failed
The exception was caused by 1 earlier exceptions
Cause number 1:
prepare step failed
The exception was caused by 1 earlier exceptions
Cause number 1:
FIPS prepare feature is supported on RHEL/CentOS-Stream 8, 9 or 10.
```
This is because now `SUPPORTED_DISTRO_PATTERNS` is a generator now.
```
SUPPORTED_DISTRO_PATTERNS = (
re.compile(pattern)
for pattern in (r'Red Hat Enterprise Linux (8|9|10)', r'CentOS Stream (8|9|10)')
)
```
And the prepare phase of the first plan already takes the first pattern
and hence there is nothing useful left for the prepare phase of the
second plan.
Signed-off-by: Ondrej Moris <ondrej.moris@gmail.com>
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.
This commit adds a new subsection to
examples.rstexplaining how to share tests across different repositories using tmt.Pull Request Checklist