Skip to content

Commit 095b9bb

Browse files
committed
Detail valid_systems and valid_prog_environs syntax in the tutorial
1 parent 71cc677 commit 095b9bb

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

docs/regression_test_api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ Modules Systems
290290
:show-inheritance:
291291

292292
.. _build-systems:
293+
293294
-------------
294295
Build Systems
295296
-------------

docs/tutorial.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ We could do that simply by setting the :attr:`valid_prog_environs` as follows:
341341
342342
self.valid_prog_environs = ['+stream']
343343
344-
This tells ReFrame that this test is valid only for environments that define the ``stream`` feature; (the ``+`` prefix requests a feature, we will explain the syntax later in this section).
345-
The syntax defined in :attr:`valid_prog_environs` allows for other requirements.
344+
This tells ReFrame that this test is valid only for environments that define the ``stream`` feature (the ``+`` prefix requests a feature; we will explain the syntax later in this section).
346345
If we try to run the test now, nothing will be run:
347346

348347
.. code-block:: bash
@@ -391,6 +390,19 @@ Let's look at some key elements of the configuration:
391390
Their definitions are resolved in the :attr:`~config.environments` section.
392391
* Every partition and environment can define a set of arbitrary features or key/value pairs in the :attr:`~config.environments.features` and :attr:`~config.environments.extras` options respectively.
393392
ReFrame will try to match system partitions and environments to a test based on the test's specification in :attr:`valid_systems` and :attr:`valid_prog_environs`.
393+
More specifically, a feature is requested with the ``+feat`` and excluded with ``-feat``, whereas an extra is requested with ``%key=val``.
394+
Multiple features or extras can be ANDed if specified in the same :attr:`valid_systems` or :attr:`valid_prog_environs` elements or otherwise ORed if specified in different elements:
395+
396+
.. code-block:: python
397+
398+
# Valid only for system partitions that define `feat0` and `key0=val` but not `feat1`
399+
valid_systems = [r'+feat0 -feat1 %key0=val']
400+
401+
# Valid only for environments with either feature `A` or `B`
402+
valid_prog_environs = ['+A', '+B']
403+
404+
Finally, a system or system partition name can be specified in :attr:`valid_systems` and similarly an environment name in :attr:`valid_prog_environs`, in which case the test is bound to those specific system partitions and/or environments.
405+
394406

395407
There are many options that we can be define for systems, partitions and environments.
396408
We will cover several of them as we go through the tutorial, but for the complete reference you should refer to :doc:`config_reference`.

0 commit comments

Comments
 (0)