Skip to contentSkip to conversation

dev-manual: Document yocto-check-layer --run-tests

PATCH Superseded Otavio Salvador 3 participants 5 messages Nov 18 – Nov 24

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dev-manual: Document yocto-check-layer --run-tests

yocto-check-layer can now run a subset of its tests with --run-tests, for example to split a long check of a BSP layer over several runs. Document the option, and that a PASS from such a run doesn't make a layer Yocto Project Compatible: that needs a single run with all the tests and, for a BSP layer, all its machines.

AI-Generated: Claude Code, Opus 5.5

---
 documentation/dev-manual/layers.rst | 13 +++++++++++++
 1 file changed, 13 insertions(+)
documentation/dev-manual/layers.rst +13 -0
index 5c8bf32b4..5a6577fd1 100644
@@ -405,6 +405,19 @@ argument should be passed as part of the command::
 These machines are the ones present in your BSP layer, in the ``conf/machine/``
 directory.
 
+To run only some of the tests, for example to split a long check over
+several runs, pass their names to the ``--run-tests`` argument, as
+``<module>[.<class>[.<name>]]``::
+
+   $ source oe-init-build-env
+   $ yocto-check-layer --run-tests bsp --machines <machine1> <machine2> ... -- your_layer_directory
+
+.. note::
+
+   A "PASS" from such a run only covers the tests and machines it ran. A
+   layer is Yocto Project Compatible only if a single run with all the
+   tests, and with all the machines of a BSP layer, passes.
+
 Entering the command causes the script to determine the type of layer
 and then to execute a set of specific tests against the layer.
 
Signature · 1 line
2.54.0
#1 lore raw

PATCH v2 1/1 dev-manual: Document yocto-check-layer --run-tests

yocto-check-layer can now run a subset of its tests with --run-tests, for example to split a long check of a BSP layer over several runs. Document the option, and that a PASS from such a run doesn't make a layer Yocto Project Compatible: that needs a single run with all the tests and, for a BSP layer, all its machines.

AI-Generated: Claude Code, Opus 5.5

---
Changes in v2:
- Use the same address for the author and the Signed-off-by.

 documentation/dev-manual/layers.rst | 13 +++++++++++++
 1 file changed, 13 insertions(+)
documentation/dev-manual/layers.rst +13 -0
index 5c8bf32b4..5a6577fd1 100644
@@ -405,6 +405,19 @@ argument should be passed as part of the command::
 These machines are the ones present in your BSP layer, in the ``conf/machine/``
 directory.
 
+To run only some of the tests, for example to split a long check over
+several runs, pass their names to the ``--run-tests`` argument, as
+``<module>[.<class>[.<name>]]``::
+
+   $ source oe-init-build-env
+   $ yocto-check-layer --run-tests bsp --machines <machine1> <machine2> ... -- your_layer_directory
+
+.. note::
+
+   A "PASS" from such a run only covers the tests and machines it ran. A
+   layer is Yocto Project Compatible only if a single run with all the
+   tests, and with all the machines of a BSP layer, passes.
+
 Entering the command causes the script to determine the type of layer
 and then to execute a set of specific tests against the layer.
 
Signature · 1 line
2.54.0
#2 lore raw

Hi Otavio,

Quoted 22 lines · Otavio Salvador via docs

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

yocto-check-layer can now run a subset of its tests with --run-tests, for example to split a long check of a BSP layer over several runs. Document the option, and that a PASS from such a run doesn't make a layer Yocto Project Compatible: that needs a single run with all the tests and, for a BSP layer, all its machines.

AI-Generated: Claude Code, Opus 5.5

---
Changes in v2:
- Use the same address for the author and the Signed-off-by.

  documentation/dev-manual/layers.rst | 13 +++++++++++++
  1 file changed, 13 insertions(+)
documentation/dev-manual/layers.rst +0 -0
index 5c8bf32b4..5a6577fd1 100644

documentation/dev-manual/layers.rst argument should be passed as part of the command:: · line 414

Quoted 10 lines
documentation/dev-manual/layers.rst +7 -0
@@ -405,6 +405,19 @@ argument should be passed as part of the command::
  These machines are the ones present in your BSP layer, in the ``conf/machine/``
  directory.
 
+To run only some of the tests, for example to split a long check over
+several runs, pass their names to the ``--run-tests`` argument, as
+``<module>[.<class>[.<name>]]``::
+
+   $ source oe-init-build-env
+   $ yocto-check-layer --run-tests bsp --machines <machine1> <machine2> ... -- your_layer_directory
+

Can you provide a more useful example where module.class.name, which you alluded to just before the code block, is used and potentially even link to the source code of the tests that are then run?

Cheers,
Quentin

#3 lore raw

PATCH v3 1/1 dev-manual: Document yocto-check-layer --run-tests

In reply to Otavio Salvador

yocto-check-layer can now run a subset of its tests with --run-tests, for example to split a long check of a BSP layer over several runs. Document the option, and that a PASS from such a run doesn't make a layer Yocto Project Compatible: that needs a single run with all the tests and, for a BSP layer, all its machines.

AI-Generated: Claude Code, Opus 5.5

---
Changes in v3:
- Explain <module>[.<class>[.<name>]], list the module and class of each test file with a link to it, and add an example running single tests (Quentin Schulz).

Changes in v2:
- Use the same address for the author and the Signed-off-by.

 documentation/dev-manual/layers.rst | 36 +++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
documentation/dev-manual/layers.rst +36 -0
index 5c8bf32b4..66877089d 100644
@@ -405,6 +405,42 @@ argument should be passed as part of the command::
 These machines are the ones present in your BSP layer, in the ``conf/machine/``
 directory.
 
+To run only some of the tests, for example to split a long check over
+several runs, pass them to the ``--run-tests`` argument as
+``<module>[.<class>[.<name>]]``: a module runs all its tests, a module and
+a class all the tests of that class, and a full name a single test. The
+modules are the files in the :oe_git:`scripts/lib/checklayer/cases
+</openembedded-core/tree/scripts/lib/checklayer/cases>` directory, each
+with one class:
+
+-  ``common``: ``CommonCheckLayer``, in :oe_git:`common.py
+   </openembedded-core/tree/scripts/lib/checklayer/cases/common.py>`.
+
+-  ``bsp``: ``BSPCheckLayer``, in :oe_git:`bsp.py
+   </openembedded-core/tree/scripts/lib/checklayer/cases/bsp.py>`.
+
+-  ``distro``: ``DistroCheckLayer``, in :oe_git:`distro.py
+   </openembedded-core/tree/scripts/lib/checklayer/cases/distro.py>`.
+
+For example, to run all the BSP tests::
+
+   $ source oe-init-build-env
+   $ yocto-check-layer --run-tests bsp --machines <machine1> <machine2> ... -- your_layer_directory
+
+Or to run only the ``test_world`` test listed below as
+``common.test_world``, and the ``test_machine_signatures`` one::
+
+   $ source oe-init-build-env
+   $ yocto-check-layer --run-tests common.CommonCheckLayer.test_world \
+         bsp.BSPCheckLayer.test_machine_signatures \
+         --machines <machine1> <machine2> ... -- your_layer_directory
+
+.. note::
+
+   A "PASS" from such a run only covers the tests and machines it ran. A
+   layer is Yocto Project Compatible only if a single run with all the
+   tests, and with all the machines of a BSP layer, passes.
+
 Entering the command causes the script to determine the type of layer
 and then to execute a set of specific tests against the layer.
 
Signature · 1 line
2.54.0
#4 lore raw
Quoted 5 lines · Otavio Salvador via docs

yocto-check-layer can now run a subset of its tests with --run-tests, for example to split a long check of a BSP layer over several runs. Document the option, and that a PASS from such a run doesn't make a layer Yocto Project Compatible: that needs a single run with all the tests and, for a BSP layer, all its machines.

[...]

Applied to master, thanks!

Antonin