From 0d5b3e60acccbe0553016352497e86436663e3eb Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Wed, 21 May 2025 13:37:49 +0200 Subject: [PATCH] ci: remove --enable-pytest from install.sh --- .gitlab/ci/build.yml | 2 -- .gitlab/ci/common.yml | 10 ++------- .gitlab/ci/pre_check.yml | 1 - .gitlab/ci/test-win.yml | 4 ++-- .gitlab/ci/upload_cache.yml | 2 +- .../esp_tee/test_apps/tee_test_fw/README.md | 2 +- components/usb/test_apps/enum/README.md | 2 +- .../contribute/esp-idf-tests-with-pytest.rst | 8 +++---- .../contribute/esp-idf-tests-with-pytest.rst | 8 +++---- examples/protocols/sockets/README.md | 2 +- tools/esp_prov/README.md | 2 +- tools/install_util.py | 8 +++---- tools/requirements.json | 6 ------ tools/requirements/requirements.pytest.txt | 21 ------------------- .../test_apps/security/secure_boot/README.md | 2 +- tools/test_build_system/README.md | 2 +- 16 files changed, 23 insertions(+), 59 deletions(-) delete mode 100644 tools/requirements/requirements.pytest.txt diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml index 28bcb315d7..af03f470e2 100644 --- a/.gitlab/ci/build.yml +++ b/.gitlab/ci/build.yml @@ -296,8 +296,6 @@ generate_build_child_pipeline: variables: PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1" script: - # requires basic pytest dependencies - - run_cmd bash install.sh --enable-pytest - run_cmd python tools/ci/dynamic_pipelines/scripts/generate_build_child_pipeline.py build_child_pipeline: diff --git a/.gitlab/ci/common.yml b/.gitlab/ci/common.yml index 953b4cbe2c..9f183916c6 100644 --- a/.gitlab/ci/common.yml +++ b/.gitlab/ci/common.yml @@ -149,19 +149,13 @@ variables: section_start "running_install_sh" "Running install.sh" if [[ "${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 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 --enable-test-specific - fi + run_cmd bash install.sh --enable-ci fi section_end "running_install_sh" else section_start "install_python_env" "Install Python environment" - run_cmd python tools/idf_tools.py install-python-env --features ci,pytest,test-specific + run_cmd python tools/idf_tools.py install-python-env --features ci,test-specific section_end "install_python_env" fi diff --git a/.gitlab/ci/pre_check.yml b/.gitlab/ci/pre_check.yml index 6effe5764f..25173d2b55 100644 --- a/.gitlab/ci/pre_check.yml +++ b/.gitlab/ci/pre_check.yml @@ -120,7 +120,6 @@ check_test_scripts_build_test_rules: PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1" script: # requires basic pytest dependencies - - run_cmd bash install.sh --enable-pytest - python tools/ci/check_build_test_rules.py check-test-scripts examples/ tools/test_apps components check_configure_ci_environment_parsing: diff --git a/.gitlab/ci/test-win.yml b/.gitlab/ci/test-win.yml index 23879f20f4..045c835f64 100644 --- a/.gitlab/ci/test-win.yml +++ b/.gitlab/ci/test-win.yml @@ -60,7 +60,7 @@ test_tools_win: PYTHONPATH: "$PYTHONPATH;$IDF_PATH\\tools;$IDF_PATH\\tools\\esp_app_trace;$IDF_PATH\\components\\partition_table;$IDF_PATH\\tools\\ci\\python_packages" script: - python -m pip install jsonschema - - .\install.ps1 --enable-ci --enable-pytest + - .\install.ps1 --enable-ci - .\export.ps1 - python "${SUBMODULE_FETCH_TOOL}" -s "all" - cd ${IDF_PATH}/tools/test_idf_py @@ -78,7 +78,7 @@ test_tools_win: after_script: [] timeout: 4 hours script: - - .\install.ps1 --enable-ci --enable-pytest + - .\install.ps1 --enable-ci - . .\export.ps1 - python "${SUBMODULE_FETCH_TOOL}" -s "all" - cd ${IDF_PATH}\tools\test_build_system diff --git a/.gitlab/ci/upload_cache.yml b/.gitlab/ci/upload_cache.yml index 173b63224b..fdd7e799cc 100644 --- a/.gitlab/ci/upload_cache.yml +++ b/.gitlab/ci/upload_cache.yml @@ -21,7 +21,7 @@ upload-pip-cache: policy: push script: - rm -rf .cache/pip # clear old packages - - bash install.sh --enable-ci --enable-pytest + - bash install.sh --enable-ci --enable-test-specific parallel: matrix: - GEO: [ 'shiny', 'brew' ] diff --git a/components/esp_tee/test_apps/tee_test_fw/README.md b/components/esp_tee/test_apps/tee_test_fw/README.md index a4ee87e6ce..9a8031229a 100644 --- a/components/esp_tee/test_apps/tee_test_fw/README.md +++ b/components/esp_tee/test_apps/tee_test_fw/README.md @@ -16,7 +16,7 @@ ```bash cd $IDF_PATH -bash install.sh --enable-ci --enable-pytest +bash install.sh --enable-ci . ./export.sh ``` diff --git a/components/usb/test_apps/enum/README.md b/components/usb/test_apps/enum/README.md index 00412bf6a6..e42bfd7de2 100644 --- a/components/usb/test_apps/enum/README.md +++ b/components/usb/test_apps/enum/README.md @@ -213,7 +213,7 @@ When all the hardware have been configured and prepared, the Test can be run via The description is provided, assuming that the test is run under Linux and Host board has a /dev/ttyACM0 path, Mocked Device has a /dev/ttyUSB0 path, and we are in the esp-idf root folder. -To run the pytest, esp-idf must be installed and configured with ```--enable-pytest```. +To run the pytest, esp-idf must be installed and configured with `--enable-ci`. ### Prepare Host diff --git a/docs/en/contribute/esp-idf-tests-with-pytest.rst b/docs/en/contribute/esp-idf-tests-with-pytest.rst index 93f134fc67..7ce23fe048 100644 --- a/docs/en/contribute/esp-idf-tests-with-pytest.rst +++ b/docs/en/contribute/esp-idf-tests-with-pytest.rst @@ -33,13 +33,13 @@ On the host side, ESP-IDF employs the pytest framework (alongside certain pytest Installation ============ -All basic 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-ci`` argument: .. code-block:: bash - $ install.sh --enable-pytest + $ install.sh --enable-ci -Additional test script specific dependencies could be installed separately by running the ESP-IDF install script with the ``--enable-pytest-specific`` argument: +Additional test script specific dependencies could be installed separately by running the ESP-IDF install script with the ``--enable-test-specific`` argument: .. code-block:: bash @@ -494,7 +494,7 @@ First you need to install ESP-IDF with additional Python requirements: .. code-block:: shell $ cd $IDF_PATH - $ bash install.sh --enable-ci --enable-pytest + $ bash install.sh --enable-ci $ . ./export.sh Build Directories 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 4ce876075a..1d4d4c8dfc 100644 --- a/docs/zh_CN/contribute/esp-idf-tests-with-pytest.rst +++ b/docs/zh_CN/contribute/esp-idf-tests-with-pytest.rst @@ -33,13 +33,13 @@ ESP-IDF 在主机端使用 pytest 框架(以及一些 pytest 插件)来自 安装 ============ -基础依赖项可以通过执行 ESP-IDF 安装脚本 ``--enable-pytest`` 进行安装: +基础依赖项可以通过执行 ESP-IDF 安装脚本 ``--enable-ci`` 进行安装: .. code-block:: bash - $ install.sh --enable-pytest + $ install.sh --enable-ci -额外的测试脚本依赖项可以通过执行 ESP-IDF 安装脚本 ``--enable-pytest-specific`` 进行安装: +额外的测试脚本依赖项可以通过执行 ESP-IDF 安装脚本 ``--enable-test-specific`` 进行安装: .. code-block:: bash @@ -494,7 +494,7 @@ CI 的工作流程如下所示: .. code-block:: shell $ cd $IDF_PATH - $ bash install.sh --enable-ci --enable-pytest + $ bash install.sh --enable-ci $ . ./export.sh 编译目录 diff --git a/examples/protocols/sockets/README.md b/examples/protocols/sockets/README.md index 771d642a7c..ccf28036b7 100644 --- a/examples/protocols/sockets/README.md +++ b/examples/protocols/sockets/README.md @@ -56,7 +56,7 @@ They can also be run locally. Ref: [ESP-IDF Tests with Pytest Guide](https://doc Example: ```bash $ cd $IDF_PATH -$ bash install.sh --enable-pytest +$ bash install.sh --enable-ci $ . ./export.sh $ cd examples/protocols/sockets/tcp_client $ python $IDF_PATH/tools/ci/ci_build_apps.py . --target esp32 -vv --pytest-apps diff --git a/tools/esp_prov/README.md b/tools/esp_prov/README.md index 02fc10bd8d..04c232fa4f 100644 --- a/tools/esp_prov/README.md +++ b/tools/esp_prov/README.md @@ -111,7 +111,7 @@ This requires the following python libraries to run: To install the dependency packages needed, please run the following command: ```shell -bash install.sh --enable-pytest +bash install.sh --enable-ci ``` **Note:** For troubleshooting errors with BLE transport, please refer this [link](https://bleak.readthedocs.io/en/latest/troubleshooting.html). diff --git a/tools/install_util.py b/tools/install_util.py index d9f97547a0..a176273869 100644 --- a/tools/install_util.py +++ b/tools/install_util.py @@ -24,9 +24,9 @@ def action_extract_features(args: str) -> None: # features to be enabled have prefix '+', disabled have prefix '-' for arg in args.split(): if arg.startswith(arg_enable_prefix): - features.append('+' + arg[len(arg_enable_prefix):]) + features.append('+' + arg[len(arg_enable_prefix) :]) elif arg.startswith(arg_disable_prefix): - features.append('-' + arg[len(arg_disable_prefix):]) + features.append('-' + arg[len(arg_disable_prefix) :]) elif arg.startswith('-'): raise SystemExit(f'ERROR: Invalid feature specifier: {arg}') features = list(set(features)) @@ -72,13 +72,13 @@ def action_print_help(script_extension: str) -> None: optional arguments: targets-to-install 'all', a single target (e.g. 'esp32s2'), or a comma-separated list of targets (e.g. 'esp32,esp32c3,esp32h2') - --enable-* a specific feature to enable (e.g. '--enable-pytest' will enable feature pytest) + --enable-* a specific feature to enable (e.g. '--enable-ci' will enable feature ci) --disable-* a specific feature to disable (e.g. '--disable-pytest' will disable feature pytest) supported features: {', '.join(features)} {help_opts} show this help message and exit For more information, please see https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/tools/idf-tools.html#install-scripts - """) # noqa: E222 + """) # noqa: E222, E501 def main() -> None: diff --git a/tools/requirements.json b/tools/requirements.json index 85ffba4041..2627f4c551 100644 --- a/tools/requirements.json +++ b/tools/requirements.json @@ -7,12 +7,6 @@ "optional": false, "requirement_path": "tools/requirements/requirements.core.txt" }, - { - "name": "pytest", - "description": "Packages for CI with pytest", - "optional": true, - "requirement_path": "tools/requirements/requirements.pytest.txt" - }, { "name": "test-specific", "description": "Packages for specific test scripts", diff --git a/tools/requirements/requirements.pytest.txt b/tools/requirements/requirements.pytest.txt deleted file mode 100644 index 68a5acb766..0000000000 --- a/tools/requirements/requirements.pytest.txt +++ /dev/null @@ -1,21 +0,0 @@ -# Python package requirements for pytest in ESP-IDF. -# This feature can be enabled by running "install.{sh,bat,ps1,fish} --enable-pytest" -# -# This file lists Python packages without version specifiers. Version details -# are stored in a separate constraints file. For more information, visit: -# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/tools/idf-tools.html - -pytest-embedded-serial-esp -pytest-embedded-idf -pytest-embedded-jtag -pytest-embedded-qemu -pytest-rerunfailures -pytest-timeout -pytest-ignore-test-results - -# ci -minio - -# build -python-gitlab -idf-build-apps diff --git a/tools/test_apps/security/secure_boot/README.md b/tools/test_apps/security/secure_boot/README.md index 9fc2e18f7d..8c31827802 100644 --- a/tools/test_apps/security/secure_boot/README.md +++ b/tools/test_apps/security/secure_boot/README.md @@ -102,7 +102,7 @@ Under `Security features` - Install pytest requirements ``` - bash $IDF_PATH/install.sh --enable-pytest + bash $IDF_PATH/install.sh --enable-ci ``` ### Build and test diff --git a/tools/test_build_system/README.md b/tools/test_build_system/README.md index 9472b642cb..4aff8ac299 100644 --- a/tools/test_build_system/README.md +++ b/tools/test_build_system/README.md @@ -9,7 +9,7 @@ This directory contains tests for the build system and build-related tools. Thes ## Running the tests locally -1. Install pytest using `install.{sh,bat,ps1,fish} --enable-pytest`. +1. Install pytest using `install.{sh,bat,ps1,fish} --enable-ci`. 1. Activate the IDF shell environment using `export.{sh,bat,ps1,fish}`. 1. To run all the tests, go to `$IDF_PATH/tools/test_build_system` directory, then run: ```