Skip to content

Commit a760bd2

Browse files
committed
Merge branch 'feat/split_pytest_requirements' into 'master'
feat: split pytest requirements to base and test-specific Closes IDFCI-2307 and IDFCI-2376 See merge request espressif/esp-idf!33429
2 parents 1889851 + bc36fda commit a760bd2

File tree

10 files changed

+56
-31
lines changed

10 files changed

+56
-31
lines changed

.gitlab/ci/common.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,16 @@ variables:
147147
# install latest python packages
148148
# target test jobs
149149
if [[ "${CI_JOB_STAGE}" == "target_test" ]]; then
150-
run_cmd bash install.sh --enable-ci --enable-pytest
150+
run_cmd bash install.sh --enable-ci --enable-pytest --enable-test-specific
151151
elif [[ "${CI_JOB_STAGE}" == "build_doc" ]]; then
152152
run_cmd bash install.sh --enable-ci --enable-docs
153153
elif [[ "${CI_JOB_STAGE}" == "build" ]]; then
154-
run_cmd bash install.sh --enable-ci --enable-pytest
154+
run_cmd bash install.sh --enable-ci
155155
else
156156
if ! echo "${CI_JOB_NAME}" | egrep ".*pytest.*"; then
157157
run_cmd bash install.sh --enable-ci
158158
else
159-
run_cmd bash install.sh --enable-ci --enable-pytest
159+
run_cmd bash install.sh --enable-ci --enable-pytest --enable-test-specific
160160
fi
161161
fi
162162

@@ -223,6 +223,8 @@ variables:
223223
- *common-before_scripts
224224
# On macOS, these tools need to be installed
225225
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
226+
# remove idf-env.json, since it may contains enabled "features"
227+
- rm -f $IDF_TOOLS_PATH/idf-env.json
226228
- $IDF_PATH/tools/idf_tools.py --non-interactive install cmake ninja
227229
# This adds tools (compilers) and the version-specific Python environment to PATH
228230
- *setup_tools_and_idf_python_venv

components/spi_flash/esp32s3/Kconfig.flash_freq

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ choice ESPTOOLPY_FLASHFREQ
1010
- Flash 120 MHz SDR mode is stable.
1111
- Flash 120 MHz DDR mode is an experimental feature, it works when
1212
the temperature is stable.
13-
Risks:
14-
If your chip powers on at a certain temperature, then after the temperature
15-
increases or decreases by approximately 20 Celsius degrees (depending on the
16-
chip), the program will crash randomly.
13+
14+
Risks:
15+
If your chip powers on at a certain temperature, then after the temperature
16+
increases or decreases by approximately 20 Celsius degrees (depending on the
17+
chip), the program will crash randomly.
1718
config ESPTOOLPY_FLASHFREQ_80M
1819
bool "80 MHz"
1920
config ESPTOOLPY_FLASHFREQ_40M

docs/en/contribute/esp-idf-tests-with-pytest.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ On the host side, ESP-IDF employs the pytest framework (alongside certain pytest
3333
Installation
3434
============
3535

36-
All dependencies could be installed by running the ESP-IDF install script with the ``--enable-pytest`` argument:
36+
All basic dependencies could be installed by running the ESP-IDF install script with the ``--enable-pytest`` argument:
3737

3838
.. code-block:: bash
3939
4040
$ install.sh --enable-pytest
4141
42+
Additional test script specific dependencies could be installed separately by running the ESP-IDF install script with the ``--enable-pytest-specific`` argument:
43+
44+
.. code-block:: bash
45+
46+
$ install.sh --enable-test-specific
47+
4248
Several mechanisms have been implemented to ensure the successful execution of the installation processes. If you encounter any issues during installation, please submit an issue report to our `GitHub issue tracker <https://github.com/espressif/esp-idf/issues>`__.
4349

4450
Common Concepts

docs/zh_CN/contribute/esp-idf-tests-with-pytest.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ ESP-IDF 在主机端使用 pytest 框架(以及一些 pytest 插件)来自
3333
安装
3434
============
3535

36-
所有依赖项都可以通过执行 ESP-IDF 安装脚本 ``--enable-pytest`` 进行安装:
36+
基础依赖项可以通过执行 ESP-IDF 安装脚本 ``--enable-pytest`` 进行安装:
3737

3838
.. code-block:: bash
3939
4040
$ install.sh --enable-pytest
4141
42+
额外的测试脚本依赖项可以通过执行 ESP-IDF 安装脚本 ``--enable-pytest-specific`` 进行安装:
43+
44+
.. code-block:: bash
45+
46+
$ install.sh --enable-test-specific
47+
4248
上面的脚本已预先实现了一些机制,以确保所有安装过程顺利进行。如果您在安装过程中遇到任何问题,请在 `GitHub Issue 版块 <https://github.com/espressif/esp-idf/issues>`__ 上提交问题说明。
4349

4450
常见概念

tools/ci/check_requirement_files.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
33
# SPDX-License-Identifier: Apache-2.0
4-
54
import json
65
import os
76
import re
@@ -13,7 +12,7 @@
1312
JSON_PATH = os.path.join(IDF_PATH, 'tools', 'requirements.json')
1413
SCHEMA_PATH = os.path.join(IDF_PATH, 'tools', 'requirements_schema.json')
1514
REQ_DIR = os.path.join(IDF_PATH, 'tools', 'requirements')
16-
RE_FEATURE = re.compile(r'requirements\.(\w+)\.txt')
15+
RE_FEATURE = re.compile(r'requirements\.([\w-]+)\.txt')
1716

1817

1918
def action_validate(req_obj: Any) -> None: # "Any" because we are checking this in this script

tools/requirements.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
"optional": true,
2020
"requirement_path": "tools/requirements/requirements.pytest.txt"
2121
},
22+
{
23+
"name": "test-specific",
24+
"description": "Packages for specific test scripts",
25+
"optional": true,
26+
"requirement_path": "tools/requirements/requirements.test-specific.txt"
27+
},
2228
{
2329
"name": "ci",
2430
"description": "Packages for ESP-IDF CI scripts",

tools/requirements/requirements.pytest.txt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,3 @@ minio
1515
# build
1616
python-gitlab
1717
idf-build-apps
18-
19-
# dependencies in pytest test scripts
20-
scapy
21-
websocket-client
22-
netifaces
23-
rangehttpserver
24-
dbus-python; sys_platform == 'linux'
25-
protobuf
26-
bleak
27-
paho-mqtt
28-
paramiko
29-
netmiko
30-
31-
# iperf_test_util
32-
pyecharts
33-
34-
# for twai tests, communicate with socket can device (e.g. Canable)
35-
python-can
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Python package requirements for specific test scripts in ESP-IDF.
2+
# This feature can be enabled by running "install.{sh,bat,ps1,fish} --enable-test-specific"
3+
4+
# dependencies in pytest test scripts
5+
scapy
6+
websocket-client
7+
netifaces
8+
rangehttpserver
9+
dbus-python; sys_platform == 'linux'
10+
protobuf
11+
bleak
12+
paho-mqtt
13+
paramiko
14+
netmiko
15+
16+
# iperf_test_util
17+
pyecharts
18+
19+
# for twai tests, communicate with socket can device (e.g. Canable)
20+
python-can

tools/test_apps/system/.build-test-rules.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ tools/test_apps/system/gdb_loadable_elf:
4545
- if: IDF_TARGET == "esp32c6" or IDF_TARGET == "esp32h2"
4646
temporary: true
4747
reason: target esp32c6, esp32h2 is not supported yet
48+
- if: IDF_TARGET == "esp32p4"
49+
temporary: true
50+
reason: build failed. IDF-11133
4851

4952
tools/test_apps/system/longjmp_test:
5053
enable:

tools/test_apps/system/gdb_loadable_elf/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C61 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
2-
| ----------------- | ----- | -------- | -------- | -------- | --------- | -------- | -------- | -------- |
1+
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C61 | ESP32-S2 | ESP32-S3 |
2+
| ----------------- | ----- | -------- | -------- | -------- | --------- | -------- | -------- |
33

44
# Loadable ELF test application
55

0 commit comments

Comments
 (0)