diff --git a/.gitlab/ci/host-test.yml b/.gitlab/ci/host-test.yml index 79bfdc19ca..b5843f2763 100644 --- a/.gitlab/ci/host-test.yml +++ b/.gitlab/ci/host-test.yml @@ -300,13 +300,11 @@ test_pytest_qemu: - run_cmd idf-ci build run --build-system cmake --target $IDF_TARGET - --only-test-related -m qemu --modified-files ${MR_MODIFIED_FILES} - run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME} - run_cmd pytest --target $IDF_TARGET - --log-cli-level DEBUG -m qemu --embedded-services idf,qemu --junitxml=XUNIT_RESULT.xml diff --git a/conftest.py b/conftest.py index 5bc43efe1b..aa19094c2a 100644 --- a/conftest.py +++ b/conftest.py @@ -300,13 +300,19 @@ def build_dir( """ # download from minio on CI case: PytestCase = request.node.stash[IDF_CI_PYTEST_CASE_KEY] - if app_downloader: + if 'skip_app_downloader' in case.all_markers: + logging.debug('skip_app_downloader marker found, skip downloading app') + downloader = None + else: + downloader = app_downloader + + if downloader: # somehow hardcoded... app_build_path = os.path.join(idf_relpath(app_path), f'build_{target}_{config}') if requires_elf_or_map(case): - app_downloader.download_app(app_build_path) + downloader.download_app(app_build_path) else: - app_downloader.download_app(app_build_path, 'flash') + downloader.download_app(app_build_path, 'flash') check_dirs = [f'build_{target}_{config}'] else: check_dirs = [] diff --git a/pytest.ini b/pytest.ini index cb9d30af80..5d570974f9 100644 --- a/pytest.ini +++ b/pytest.ini @@ -39,6 +39,7 @@ junit_log_passing_tests = False markers = temp_skip_ci: mark test to be skipped in CI temp_skip: mark test to be skipped in CI and locally + skip_app_downloader: mark test required apps built locally, not downloaded from CI require_elf: mark test to be skipped if no elf file is found env_markers = diff --git a/tools/ci/idf_pytest/plugin.py b/tools/ci/idf_pytest/plugin.py index 81980a5d89..86c1005607 100644 --- a/tools/ci/idf_pytest/plugin.py +++ b/tools/ci/idf_pytest/plugin.py @@ -150,6 +150,9 @@ class IdfLocalPlugin: if 'esp32c2' in case.targets and 'xtal_26mhz' not in case.all_markers: item.add_marker('xtal_40mhz') + if 'host_test' in case.all_markers: + item.add_marker('skip_app_downloader') # host_test jobs will build the apps itself + def pytest_custom_test_case_name(self, item: Function) -> str: return item.funcargs.get('test_case_name', item.nodeid) # type: ignore