Skip to content

Commit 795c436

Browse files
committed
docs(ci): Add explanation about requires field in JSON
1 parent 97b461f commit 795c436

File tree

1 file changed

+36
-11
lines changed

1 file changed

+36
-11
lines changed

docs/en/contributing.rst

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,39 @@ Also:
109109
Testing
110110
*******
111111

112-
Be sure you have tested the example in all the supported targets. If the example works only with specific targets,
113-
edit/add the ``ci.json`` in the same folder as the sketch to specify the supported targets. By default,
114-
all targets are assumed to be supported.
112+
Be sure you have tested the example in all the supported targets. If the example some specific hardware requirements,
113+
edit/add the ``ci.json`` in the same folder as the sketch to specify the required configurations from ``sdkconfig``.
114+
This will ensure that the CI system will run the test only on the targets that have the required configurations.
115+
You can check the available configurations in the ``sdkconfig`` file in the ``tools/esp32-arduino-libs/<target>`` folder.
115116

116-
Here is an example of the ``ci.json`` file where the example does not support ESP32-H2 and ESP32-S2:
117+
Here is an example of the ``ci.json`` file where the example requires Wi-Fi to work properly:
117118

118119
.. code-block:: json
119120
120121
{
122+
"requires": [
123+
"CONFIG_SOC_WIFI_SUPPORTED=y"
124+
]
125+
}
126+
127+
.. note::
128+
129+
The list of configurations will be checked against the ``sdkconfig`` file in the target folder. If the configuration is not present in the ``sdkconfig``,
130+
the test will be skipped for that target. That means that the test will only run on the targets that have **ALL** the required configurations.
131+
132+
Sometimes, the example might not be supported by some target, even if the target has the required configurations
133+
(like resources limitations or requiring a specific SoC). To avoid compilation errors, you can add the target to the ``ci.json``
134+
file so the CI system will force to skip the test on that target.
135+
136+
Here is an example of the ``ci.json`` file where the example is requires Wi-Fi to work properly but is also not supported by the ESP32-S2 target:
137+
138+
.. code-block:: json
139+
140+
{
141+
"requires": [
142+
"CONFIG_SOC_WIFI_SUPPORTED=y"
143+
],
121144
"targets": {
122-
"esp32h2": false,
123145
"esp32s2": false
124146
}
125147
}
@@ -130,17 +152,17 @@ For example, in the sketch:
130152
.. code-block:: arduino
131153
132154
/*
133-
THIS FEATURE IS SUPPORTED ONLY BY ESP32-S2 AND ESP32-C3
155+
THIS FEATURE REQUIRES WI-FI SUPPORT AND IS NOT AVAILABLE FOR ESP32-S2 AS IT DOES NOT HAVE ENOUGH RAM.
134156
*/
135157
136158
And in the ``README.md`` file:
137159

138160
.. code-block:: markdown
139161
140-
Currently, this example supports the following targets.
162+
Currently, this example requires Wi-Fi and supports the following targets.
141163
142-
| Supported Targets | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 |
143-
| ----------------- | ----- | -------- | -------- | -------- |
164+
| Supported Targets | ESP32 | ESP32-H2 | ESP32-S3 | ESP32-C3 | ESP32-C6 |
165+
| ----------------- | ----- | -------- | -------- | -------- | -------- |
144166
145167
Example Template
146168
****************
@@ -341,8 +363,11 @@ CI JSON File
341363

342364
The ``ci.json`` file is used to specify how the test suite and sketches will handled by the CI system. It can contain the following fields:
343365

344-
* ``targets``: A dictionary that specifies the supported targets. The key is the target name and the value is a boolean that specifies if the
345-
target is supported. By default, all targets are assumed to be supported. This field is also valid for examples.
366+
* ``requires``: A list of configurations in ``sdkconfig`` that are required to run the test suite. The test suite will only run on the targets
367+
that have the required configurations. By default, no configurations are required.
368+
* ``targets``: A dictionary that specifies the targets for which the tests will be run. The key is the target name and the value is a boolean
369+
that specifies if the test should be run for that target. By default, all targets are enabled as long as they have the required configurations
370+
specified in the ``requires`` field. This field is also valid for examples.
346371
* ``platforms``: A dictionary that specifies the supported platforms. The key is the platform name and the value is a boolean that specifies if
347372
the platform is supported. By default, all platforms are assumed to be supported.
348373
* ``extra_tags``: A list of extra tags that the runner will require when running the test suite in hardware. By default, no extra tags are required.

0 commit comments

Comments
 (0)