test(cmakev2): Enable CI tests for component manager for cmakev2

This commit adapts the component manager build tests for cmakev2 and
enables them for CI test runs.
This commit is contained in:
Sudeep Mohanty
2025-10-30 17:17:49 +08:00
committed by BOT
parent 1017be951b
commit 0c69d53b68
3 changed files with 18 additions and 0 deletions
+1
View File
@@ -272,6 +272,7 @@ pytest_buildv2_system:
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
-- --
test_non_default_target.py test_non_default_target.py
test_component_manager.py
pytest_build_system_macos: pytest_build_system_macos:
extends: extends:
@@ -9,3 +9,16 @@ include($ENV{IDF_PATH}/tools/cmakev2/idf.cmake)
project(build_test_app C CXX ASM) project(build_test_app C CXX ASM)
idf_project_default() idf_project_default()
# When doing idf.py add-dependency, the component manager
# expects the tools/cmake/project.cmake file to be included
# in the project-level CMakeLists.txt file. If it does not
# find it, it assumes that that the project-root directory
# is a component and crates a manifest in the project-root
# directory. Hence, as a workaround, we trick the component
# manager by including the tools/cmake/project.cmake file
# but return early.
# TODO: Remove this workaround (IDF-14072)
return()
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
@@ -4,6 +4,7 @@ import json
import os.path import os.path
from pathlib import Path from pathlib import Path
import pytest
from test_build_system_helpers import IdfPyFunc from test_build_system_helpers import IdfPyFunc
from test_build_system_helpers import replace_in_file from test_build_system_helpers import replace_in_file
@@ -158,6 +159,9 @@ class TestOptionalDependencyWithKconfig:
) )
assert 'Missing required kconfig option after retry.' in res.stderr assert 'Missing required kconfig option after retry.' in res.stderr
@pytest.mark.buildv2_skip(
'cmakev2 needs explicit REQUIRES for EXTRA_COMPONENT_DIRS as no special handling of the main component occurs'
)
def test_kconfig_in_transitive_dependency(self, idf_py: IdfPyFunc, test_app_copy: Path) -> None: def test_kconfig_in_transitive_dependency(self, idf_py: IdfPyFunc, test_app_copy: Path) -> None:
idf_py('create-component', 'foo') idf_py('create-component', 'foo')
(test_app_copy / 'foo' / 'idf_component.yml').write_text(""" (test_app_copy / 'foo' / 'idf_component.yml').write_text("""