Skip to content

Commit 874b2a1

Browse files
docs: Add example for sharing tests across repositories
This commit adds a new subsection to `examples.rst` explaining how to share tests across different repositories using tmt.
1 parent 4ef0102 commit 874b2a1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/examples.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,30 @@ the :ref:`/spec/plans/discover` step:
537537
url: https://src.fedoraproject.org/rpms/tmt/
538538
539539
540+
Share Tests Across Repositories
541+
------------------------------------------------------------------
542+
543+
Another way to efficiently manage tests is by sharing them across repositories.
544+
This can be achieved by referencing the repository containing shared tests
545+
within the ``discover`` step of a plan. TMT will then fetch the tests from the
546+
specified URL and make them available for execution alongside project-specific
547+
tests. This promotes reusability and reduces duplication of common test cases.
548+
549+
.. code-block:: yaml
550+
551+
discover:
552+
- name: shared-tests
553+
how: fmf
554+
url: https://example.com/path/to/shared-tests.git
555+
# Optionally, specify a branch or tag
556+
# ref: main
557+
- name: project-specific-tests
558+
how: fmf
559+
# Assuming tests are in the current repository
560+
# url: .
561+
# filter: ...
562+
563+
540564
Extend Steps
541565
------------------------------------------------------------------
542566

0 commit comments

Comments
 (0)