diff --git a/.gitlab/ci/host-test.yml b/.gitlab/ci/host-test.yml index 6d32d7c82e4..24c995585b6 100644 --- a/.gitlab/ci/host-test.yml +++ b/.gitlab/ci/host-test.yml @@ -483,6 +483,7 @@ pytest_buildv2_system: --junitxml ${CI_PROJECT_DIR}/XUNIT_RESULT.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} -- + buildv2 test_non_default_target.py test_component_manager.py test_build.py diff --git a/.gitlab/ci/test-win.yml b/.gitlab/ci/test-win.yml index c617358959f..bb4ab49a5de 100644 --- a/.gitlab/ci/test-win.yml +++ b/.gitlab/ci/test-win.yml @@ -171,6 +171,7 @@ pytest_buildv2_system_win: --junitxml=${CI_PROJECT_DIR}\XUNIT_RESULT.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} -- + buildv2 test_non_default_target.py test_component_manager.py test_build.py diff --git a/tools/test_build_system/conftest.py b/tools/test_build_system/conftest.py index 69ca91e6b5e..d8d85ce0a0e 100644 --- a/tools/test_build_system/conftest.py +++ b/tools/test_build_system/conftest.py @@ -241,13 +241,18 @@ def idf_py(default_idf_env: EnvDict) -> IdfPyFunc: def pytest_collection_modifyitems(session: Session, config: Config, items: list[Item]) -> None: - if not config.getoption('--buildv2', False): - return + buildv2_dir = Path(__file__).parent / 'buildv2' + is_buildv2 = config.getoption('--buildv2', False) + for item in items: - marker = item.get_closest_marker('buildv2_skip') - if marker: - reason = marker.args[0] if marker.args else 'Skipped as this test is specific to build system v1.' - item.add_marker(pytest.mark.skip(reason=reason)) + if is_buildv2: + marker = item.get_closest_marker('buildv2_skip') + if marker: + reason = marker.args[0] if marker.args else 'Skipped as this test is specific to build system v1.' + item.add_marker(pytest.mark.skip(reason=reason)) + else: + if buildv2_dir in item.path.parents or item.path == buildv2_dir: + item.add_marker(pytest.mark.skip(reason='Skipped as build system v2 tests are disabled.')) def pytest_report_header(config: Config) -> str: