Merge branch 'test/run_supported_cmake_tests_v5.5' into 'release/v5.5'

test(tools): Added minimal supported cmake versions build system tests (v5.5)

See merge request espressif/esp-idf!49288
This commit is contained in:
Roland Dobai
2026-07-24 15:01:16 +02:00
4 changed files with 79 additions and 9 deletions

View File

@@ -461,6 +461,29 @@ test_pytest_macos:
--junitxml ${CI_PROJECT_DIR}/XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
.test_build_system_minimal_cmake_template:
extends: .test_build_system_template
variables:
INSTALL_EXTRA_TOOLS: cmake@3.16.3
script:
- MINIMAL_SUPPORTED_CMAKE_VERSION=$(echo "${INSTALL_EXTRA_TOOLS}" | sed -n 's/.*cmake@\([0-9.]*\).*/\1/p')
- export PATH=$(echo "$PATH" | sed -E "s|/tools/cmake/[0-9.]+|/tools/cmake/${MINIMAL_SUPPORTED_CMAKE_VERSION}|")
- ACTUAL_CMAKE_VERSION=$(cmake --version | head -n1 | awk '{print $3}')
- |
if [ "${ACTUAL_CMAKE_VERSION}" != "${MINIMAL_SUPPORTED_CMAKE_VERSION}" ]; then
echo "ERROR: Wrong minimal CMake version! Detected: ${ACTUAL_CMAKE_VERSION}, but should be: ${MINIMAL_SUPPORTED_CMAKE_VERSION}"
exit 1
fi
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- cd ${IDF_PATH}/tools/test_build_system
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- pytest
-k cmake
--cleanup-idf-copy
--work-dir ${CI_PROJECT_DIR}/test_build_system
--junitxml ${CI_PROJECT_DIR}/XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
pytest_build_system:
extends: .test_build_system_template
parallel: 3
@@ -471,3 +494,14 @@ pytest_build_system_macos:
- .brew-macos-settings
- .rules:build:macos
parallel: 3
pytest_build_system_minimal_cmake:
extends: .test_build_system_minimal_cmake_template
pytest_build_system_macos_minimal_cmake:
extends:
- .test_build_system_minimal_cmake_template
- .brew-macos-settings
- .rules:build:macos
variables:
INSTALL_EXTRA_TOOLS: ninja cmake@3.16.3

View File

@@ -106,3 +106,37 @@ pytest_build_system_win:
reports:
junit: XUNIT_RESULT.xml
when: always
pytest_build_system_win_minimal_cmake:
extends:
- .test_build_system_template_win
- .rules:labels:windows_pytest_build_system
needs:
- job: manual_gate
optional: true
tags: [windows-build, brew]
artifacts:
paths:
- XUNIT_RESULT.xml
- test_build_system
expire_in: 2 days
reports:
junit: XUNIT_RESULT.xml
when: always
variables:
MINIMAL_CMAKE_VERSION: "3.16.3"
script:
- .\install.ps1 --enable-ci
- . .\export.ps1
- python ${IDF_PATH}\tools\idf_tools.py install cmake@${MINIMAL_CMAKE_VERSION}
- $Env:PATH = "$Env:USERPROFILE\.espressif\tools\cmake\${MINIMAL_CMAKE_VERSION}\bin;$Env:PATH"
- |
$actualVersion = (& cmake --version).Split()[2]
if ($actualVersion -ne $Env:MINIMAL_CMAKE_VERSION) {
Write-Error "ERROR: Wrong CMake version! Detected: $actualVersion, but expected: $Env:MINIMAL_CMAKE_VERSION"
exit 1
}
- python "${SUBMODULE_FETCH_TOOL}" -s "all"
- cd ${IDF_PATH}\tools\test_build_system
- idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- pytest -k cmake --junitxml=${CI_PROJECT_DIR}\XUNIT_RESULT.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}

View File

@@ -1,5 +1,5 @@
[pytest]
addopts = -s -p no:pytest_embedded -p no:idf-ci
addopts = -s -p no:idf-ci
# log related
log_cli = True

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import logging
import os
@@ -8,7 +8,12 @@ import sys
import tempfile
import unittest
import pexpect
if sys.platform == 'win32':
import pytest
pytest.skip('pexpect.spawn is not available on Windows', allow_module_level=True)
else:
import pexpect
class IdfPyQemuTest(unittest.TestCase):
@@ -17,11 +22,9 @@ class IdfPyQemuTest(unittest.TestCase):
idf_path = os.environ['IDF_PATH']
hello_world_dir = os.path.join(idf_path, 'examples', 'get-started', 'hello_world')
idf_py = os.path.join(idf_path, 'tools', 'idf.py')
args = [idf_py, '-C', hello_world_dir, '-B', build_dir,
'qemu', '--qemu-extra-args', '-no-reboot', 'monitor']
args = [idf_py, '-C', hello_world_dir, '-B', build_dir, 'qemu', '--qemu-extra-args', '-no-reboot', 'monitor']
logfile_name = os.path.join(os.environ['IDF_PATH'], 'qemu_log.out')
with open(logfile_name, 'w+b') as logfile, \
pexpect.spawn(sys.executable, args=args, logfile=logfile) as child:
with open(logfile_name, 'w+b') as logfile, pexpect.spawn(sys.executable, args=args, logfile=logfile) as child:
child.expect_exact('Executing action: all')
logging.info('Waiting for the build to finish...')
child.expect_exact('Executing action: qemu', timeout=120)
@@ -33,8 +36,7 @@ class IdfPyQemuTest(unittest.TestCase):
child.expect_exact('Restarting now.')
args = [idf_py, '-C', hello_world_dir, '-B', build_dir, 'qemu', 'efuse-summary', '--format=summary']
with open(logfile_name, 'w+b') as logfile, \
pexpect.spawn(sys.executable, args=args, logfile=logfile) as child:
with open(logfile_name, 'w+b') as logfile, pexpect.spawn(sys.executable, args=args, logfile=logfile) as child:
child.expect_exact('Executing action: efuse-summary')
child.expect_exact('WR_DIS (BLOCK0)')