You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci(json): Add configuration requirements to ci.json files (#10385)
* ci(json): Add support for checking sdkconfig before running tests
* docs(ci): Add explanation about requires field in JSON
* fix(json): Ignore comments when searching requirements
* feat(json): Add extended regex support to requires field
* change(json): Move to using requirements in JSON
* fix(json): Fix requirements for touch tests
* refactor(json): Fix formatting of JSON files
* fix(spi): Fix SPI example and JSON
Copy file name to clipboardexpand all lines: docs/en/contributing.rst
+41-11
Original file line number
Diff line number
Diff line change
@@ -109,17 +109,44 @@ Also:
109
109
Testing
110
110
*******
111
111
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 regular expression for the
114
+
required configurations from ``sdkconfig``.
115
+
This will ensure that the CI system will run the test only on the targets that have the required configurations.
115
116
116
-
Here is an example of the ``ci.json`` file where the example does not support ESP32-H2 and ESP32-S2:
117
+
You can check the available configurations in the ``sdkconfig`` file in the ``tools/esp32-arduino-libs/<target>`` folder.
118
+
119
+
Here is an example of the ``ci.json`` file where the example requires Wi-Fi to work properly:
120
+
121
+
.. code-block:: json
122
+
123
+
{
124
+
"requires": [
125
+
"CONFIG_SOC_WIFI_SUPPORTED=y"
126
+
]
127
+
}
128
+
129
+
.. note::
130
+
131
+
The list of configurations will be checked against the ``sdkconfig`` file in the target folder. If the configuration is not present in the ``sdkconfig``,
132
+
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.
133
+
134
+
Also, by default, the "match start of line" character (``^``) will be added to the beginning of each configuration.
135
+
That means that the configuration must be at the beginning of the line in the ``sdkconfig`` file.
136
+
137
+
Sometimes, the example might not be supported by some target, even if the target has the required configurations
138
+
(like resources limitations or requiring a specific SoC). To avoid compilation errors, you can add the target to the ``ci.json``
139
+
file so the CI system will force to skip the test on that target.
140
+
141
+
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:
117
142
118
143
.. code-block:: json
119
144
120
145
{
146
+
"requires": [
147
+
"CONFIG_SOC_WIFI_SUPPORTED=y"
148
+
],
121
149
"targets": {
122
-
"esp32h2": false,
123
150
"esp32s2": false
124
151
}
125
152
}
@@ -130,17 +157,17 @@ For example, in the sketch:
130
157
.. code-block:: arduino
131
158
132
159
/*
133
-
THIS FEATURE IS SUPPORTED ONLY BY ESP32-S2 AND ESP32-C3
160
+
THIS FEATURE REQUIRES WI-FI SUPPORT AND IS NOT AVAILABLE FOR ESP32-S2 AS IT DOES NOT HAVE ENOUGH RAM.
134
161
*/
135
162
136
163
And in the ``README.md`` file:
137
164
138
165
.. code-block:: markdown
139
166
140
-
Currently, this example supports the following targets.
167
+
Currently, this example requires Wi-Fi and supports the following targets.
0 commit comments