diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml index ce6ccfd276..6147e13503 100644 --- a/.gitlab/ci/build.yml +++ b/.gitlab/ci/build.yml @@ -309,7 +309,11 @@ generate_build_child_pipeline: - non_test_related_apps.txt expire_in: 1 week when: always + 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/pre_check.yml b/.gitlab/ci/pre_check.yml index 31dfb07266..2acc5ef0bf 100644 --- a/.gitlab/ci/pre_check.yml +++ b/.gitlab/ci/pre_check.yml @@ -117,8 +117,10 @@ check_test_scripts_build_test_rules: extends: - .pre_check_template - .before_script:build + variables: + PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1" script: - # required pytest related packages + # 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 diff --git a/tools/ci/python_packages/common_test_methods.py b/tools/ci/python_packages/common_test_methods.py index 80392fbc27..fe5db2a9e7 100644 --- a/tools/ci/python_packages/common_test_methods.py +++ b/tools/ci/python_packages/common_test_methods.py @@ -1,12 +1,19 @@ -# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import logging import os import socket -from typing import Any, List +from typing import Any +from typing import List + +try: + import netifaces +except ImportError: + from unittest.mock import MagicMock + + netifaces = MagicMock() + logging.warning('netifaces is not installed. Please install it to get network interface information.') -import netifaces import yaml ENV_CONFIG_FILE_SEARCH = [ diff --git a/tools/requirements/requirements.ci.txt b/tools/requirements/requirements.ci.txt index fa1ac259d4..dfec5b20fc 100644 --- a/tools/requirements/requirements.ci.txt +++ b/tools/requirements/requirements.ci.txt @@ -15,3 +15,4 @@ pyyaml SimpleWebSocketServer pylint-gitlab minio +prettytable