Skip to content

Commit c7fe256

Browse files
committed
Document new interface
Signed-off-by: Cristian Le <git@lecris.dev>
1 parent fbb57cb commit c7fe256

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

docs/releases/pending/4427.fmf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
description: |
2+
Beakerlib libraries can now be referenced without a ``url`` or ``path`` key.
3+
In that case the ``name`` is relative to the discovered test's tmt tree.
4+
The ``nick`` key **must** be set in this situation, matching what the
5+
consuming scripts are using in ``rlImport``, or the name of the repo or
6+
equivalent.

spec/tests/require.fmf

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ description: |
3434

3535
By default, fetched repositories are stored in the discover
3636
step workdir under the ``libs`` directory. Use optional key
37-
``destination`` to choose a different location. The ``nick``
38-
key can be used to override the default git repository name.
37+
``destination`` to choose a different location.
38+
39+
.. note::
40+
:name: nick-usage
41+
42+
The name of the beakerlib library (the value used with
43+
``rlImport``) is taken as the last directory pointed by
44+
``url`` or ``path``. Use the ``nick`` key if you need
45+
to override this.
3946

4047
For debugging beakerlib libraries it is useful to reference
4148
the development version directly from the local filesystem.
@@ -49,6 +56,13 @@ description: |
4956
__ https://github.com/beakerlib/
5057
__ https://fmf.readthedocs.io/en/latest/concept.html#identifiers
5158

59+
.. versionadded:: 1.65
60+
As a special handling when using ``type: library``, if both
61+
``url`` and ``path`` is omitted, the current test's tree is
62+
used as the repo of the library. The ``nick`` key **must**
63+
be set in this case (see :ref:`previous note<nick-usage>`
64+
for what values to set for this)
65+
5266
example:
5367
- |
5468
# Require a single package
@@ -75,6 +89,13 @@ example:
7589
url: https://github.com/beakerlib/openssl
7690
name: /certgen
7791

92+
- |
93+
# Library from the current tmt tree
94+
require:
95+
- type: library
96+
name: /certgen
97+
nick: openssl
98+
7899
- |
79100
# Library from the local filesystem
80101
require:

0 commit comments

Comments
 (0)