From dca046509508a4f254e08cb961215e94ea0145e6 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Tue, 10 Sep 2024 10:13:57 +0200 Subject: [PATCH 1/4] feat: split pytest requirements to base and test-specific --- .gitlab/ci/common.yml | 6 +++--- .../contribute/esp-idf-tests-with-pytest.rst | 8 +++++++- .../contribute/esp-idf-tests-with-pytest.rst | 8 +++++++- tools/ci/check_requirement_files.py | 3 +-- tools/requirements.json | 6 ++++++ tools/requirements/requirements.pytest.txt | 18 ----------------- .../requirements.test-specific.txt | 20 +++++++++++++++++++ 7 files changed, 44 insertions(+), 25 deletions(-) create mode 100644 tools/requirements/requirements.test-specific.txt diff --git a/.gitlab/ci/common.yml b/.gitlab/ci/common.yml index 5f80c6ba264..298631b9129 100644 --- a/.gitlab/ci/common.yml +++ b/.gitlab/ci/common.yml @@ -147,16 +147,16 @@ variables: # install latest python packages # target test jobs if [[ "${CI_JOB_STAGE}" == "target_test" ]]; then - run_cmd bash install.sh --enable-ci --enable-pytest + run_cmd bash install.sh --enable-ci --enable-pytest --enable-test-specific elif [[ "${CI_JOB_STAGE}" == "build_doc" ]]; then run_cmd bash install.sh --enable-ci --enable-docs elif [[ "${CI_JOB_STAGE}" == "build" ]]; then - run_cmd bash install.sh --enable-ci --enable-pytest + run_cmd bash install.sh --enable-ci else if ! echo "${CI_JOB_NAME}" | egrep ".*pytest.*"; then run_cmd bash install.sh --enable-ci else - run_cmd bash install.sh --enable-ci --enable-pytest + run_cmd bash install.sh --enable-ci --enable-pytest --enable-test-specific fi fi diff --git a/docs/en/contribute/esp-idf-tests-with-pytest.rst b/docs/en/contribute/esp-idf-tests-with-pytest.rst index a27137ec3a2..424bf4218e2 100644 --- a/docs/en/contribute/esp-idf-tests-with-pytest.rst +++ b/docs/en/contribute/esp-idf-tests-with-pytest.rst @@ -33,12 +33,18 @@ On the host side, ESP-IDF employs the pytest framework (alongside certain pytest Installation ============ -All dependencies could be installed by running the ESP-IDF install script with the ``--enable-pytest`` argument: +All basic dependencies could be installed by running the ESP-IDF install script with the ``--enable-pytest`` argument: .. code-block:: bash $ install.sh --enable-pytest +Additional test script specific dependencies could be installed separately by running the ESP-IDF install script with the ``--enable-pytest-specific`` argument: + +.. code-block:: bash + + $ install.sh --enable-test-specific + 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 `__. Common Concepts diff --git a/docs/zh_CN/contribute/esp-idf-tests-with-pytest.rst b/docs/zh_CN/contribute/esp-idf-tests-with-pytest.rst index 99f3d9b6b74..db6ffa1df9c 100644 --- a/docs/zh_CN/contribute/esp-idf-tests-with-pytest.rst +++ b/docs/zh_CN/contribute/esp-idf-tests-with-pytest.rst @@ -33,12 +33,18 @@ ESP-IDF 在主机端使用 pytest 框架(以及一些 pytest 插件)来自 安装 ============ -所有依赖项都可以通过执行 ESP-IDF 安装脚本 ``--enable-pytest`` 进行安装: +基础依赖项可以通过执行 ESP-IDF 安装脚本 ``--enable-pytest`` 进行安装: .. code-block:: bash $ install.sh --enable-pytest +额外的测试脚本依赖项可以通过执行 ESP-IDF 安装脚本 ``--enable-pytest-specific`` 进行安装: + +.. code-block:: bash + + $ install.sh --enable-test-specific + 上面的脚本已预先实现了一些机制,以确保所有安装过程顺利进行。如果您在安装过程中遇到任何问题,请在 `GitHub Issue 版块 `__ 上提交问题说明。 常见概念 diff --git a/tools/ci/check_requirement_files.py b/tools/ci/check_requirement_files.py index b91790801e0..85e0571ce79 100755 --- a/tools/ci/check_requirement_files.py +++ b/tools/ci/check_requirement_files.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import json import os import re @@ -13,7 +12,7 @@ JSON_PATH = os.path.join(IDF_PATH, 'tools', 'requirements.json') SCHEMA_PATH = os.path.join(IDF_PATH, 'tools', 'requirements_schema.json') REQ_DIR = os.path.join(IDF_PATH, 'tools', 'requirements') -RE_FEATURE = re.compile(r'requirements\.(\w+)\.txt') +RE_FEATURE = re.compile(r'requirements\.([\w-]+)\.txt') def action_validate(req_obj: Any) -> None: # "Any" because we are checking this in this script diff --git a/tools/requirements.json b/tools/requirements.json index ac5ced813ad..c31f8953358 100644 --- a/tools/requirements.json +++ b/tools/requirements.json @@ -19,6 +19,12 @@ "optional": true, "requirement_path": "tools/requirements/requirements.pytest.txt" }, + { + "name": "test-specific", + "description": "Packages for specific test scripts", + "optional": true, + "requirement_path": "tools/requirements/requirements.test-specific.txt" + }, { "name": "ci", "description": "Packages for ESP-IDF CI scripts", diff --git a/tools/requirements/requirements.pytest.txt b/tools/requirements/requirements.pytest.txt index 277a8a09de8..d94ee14ddb0 100644 --- a/tools/requirements/requirements.pytest.txt +++ b/tools/requirements/requirements.pytest.txt @@ -15,21 +15,3 @@ minio # build python-gitlab idf-build-apps - -# dependencies in pytest test scripts -scapy -websocket-client -netifaces -rangehttpserver -dbus-python; sys_platform == 'linux' -protobuf -bleak -paho-mqtt -paramiko -netmiko - -# iperf_test_util -pyecharts - -# for twai tests, communicate with socket can device (e.g. Canable) -python-can diff --git a/tools/requirements/requirements.test-specific.txt b/tools/requirements/requirements.test-specific.txt new file mode 100644 index 00000000000..5f8745716aa --- /dev/null +++ b/tools/requirements/requirements.test-specific.txt @@ -0,0 +1,20 @@ +# Python package requirements for specific test scripts in ESP-IDF. +# This feature can be enabled by running "install.{sh,bat,ps1,fish} --enable-test-specific" + +# dependencies in pytest test scripts +scapy +websocket-client +netifaces +rangehttpserver +dbus-python; sys_platform == 'linux' +protobuf +bleak +paho-mqtt +paramiko +netmiko + +# iperf_test_util +pyecharts + +# for twai tests, communicate with socket can device (e.g. Canable) +python-can From 1fa6d49f6f7c70c43a832c024534218f1be942aa Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Wed, 11 Sep 2024 17:20:51 +0200 Subject: [PATCH 2/4] ci: remove idf-env.json before install.sh for macos jobs --- .gitlab/ci/common.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab/ci/common.yml b/.gitlab/ci/common.yml index 298631b9129..9708396b5fd 100644 --- a/.gitlab/ci/common.yml +++ b/.gitlab/ci/common.yml @@ -223,6 +223,8 @@ variables: - *common-before_scripts # On macOS, these tools need to be installed - export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}" + # remove idf-env.json, since it may contains enabled "features" + - rm -f $IDF_TOOLS_PATH/idf-env.json - $IDF_PATH/tools/idf_tools.py --non-interactive install cmake ninja # This adds tools (compilers) and the version-specific Python environment to PATH - *setup_tools_and_idf_python_venv From dc1851bd5a043348483757d4473569a4138fb328 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Thu, 12 Sep 2024 12:00:42 +0200 Subject: [PATCH 3/4] docs: fix indentation error in s3 spi_flash kconfig --- components/spi_flash/esp32s3/Kconfig.flash_freq | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/spi_flash/esp32s3/Kconfig.flash_freq b/components/spi_flash/esp32s3/Kconfig.flash_freq index b4d149c7ed0..83fbe73a7c0 100644 --- a/components/spi_flash/esp32s3/Kconfig.flash_freq +++ b/components/spi_flash/esp32s3/Kconfig.flash_freq @@ -10,10 +10,11 @@ choice ESPTOOLPY_FLASHFREQ - Flash 120 MHz SDR mode is stable. - Flash 120 MHz DDR mode is an experimental feature, it works when the temperature is stable. - Risks: - If your chip powers on at a certain temperature, then after the temperature - increases or decreases by approximately 20 Celsius degrees (depending on the - chip), the program will crash randomly. + + Risks: + If your chip powers on at a certain temperature, then after the temperature + increases or decreases by approximately 20 Celsius degrees (depending on the + chip), the program will crash randomly. config ESPTOOLPY_FLASHFREQ_80M bool "80 MHz" config ESPTOOLPY_FLASHFREQ_40M From bc36fda936df22b6c4737f64ba5969b202ef08fe Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Thu, 12 Sep 2024 15:04:00 +0200 Subject: [PATCH 4/4] ci: temp disable esp32p4 for loadable ram --- tools/test_apps/system/.build-test-rules.yml | 3 +++ tools/test_apps/system/gdb_loadable_elf/README.md | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/test_apps/system/.build-test-rules.yml b/tools/test_apps/system/.build-test-rules.yml index 209d0e98662..fce0c773f37 100644 --- a/tools/test_apps/system/.build-test-rules.yml +++ b/tools/test_apps/system/.build-test-rules.yml @@ -45,6 +45,9 @@ tools/test_apps/system/gdb_loadable_elf: - if: IDF_TARGET == "esp32c6" or IDF_TARGET == "esp32h2" temporary: true reason: target esp32c6, esp32h2 is not supported yet + - if: IDF_TARGET == "esp32p4" + temporary: true + reason: build failed. IDF-11133 tools/test_apps/system/longjmp_test: enable: diff --git a/tools/test_apps/system/gdb_loadable_elf/README.md b/tools/test_apps/system/gdb_loadable_elf/README.md index 3296c7a65d3..5c3ef8d826e 100644 --- a/tools/test_apps/system/gdb_loadable_elf/README.md +++ b/tools/test_apps/system/gdb_loadable_elf/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C61 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C61 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | --------- | -------- | -------- | # Loadable ELF test application