ci: skip app downloader for host test cases

This commit is contained in:
Fu Hanxi
2025-07-16 10:35:21 +02:00
parent 158eb78555
commit 76181e5fce
4 changed files with 13 additions and 5 deletions

View File

@@ -300,13 +300,11 @@ test_pytest_qemu:
- run_cmd idf-ci build run - run_cmd idf-ci build run
--build-system cmake --build-system cmake
--target $IDF_TARGET --target $IDF_TARGET
--only-test-related
-m qemu -m qemu
--modified-files ${MR_MODIFIED_FILES} --modified-files ${MR_MODIFIED_FILES}
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME} - run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- run_cmd pytest - run_cmd pytest
--target $IDF_TARGET --target $IDF_TARGET
--log-cli-level DEBUG
-m qemu -m qemu
--embedded-services idf,qemu --embedded-services idf,qemu
--junitxml=XUNIT_RESULT.xml --junitxml=XUNIT_RESULT.xml

View File

@@ -300,13 +300,19 @@ def build_dir(
""" """
# download from minio on CI # download from minio on CI
case: PytestCase = request.node.stash[IDF_CI_PYTEST_CASE_KEY] 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... # somehow hardcoded...
app_build_path = os.path.join(idf_relpath(app_path), f'build_{target}_{config}') app_build_path = os.path.join(idf_relpath(app_path), f'build_{target}_{config}')
if requires_elf_or_map(case): if requires_elf_or_map(case):
app_downloader.download_app(app_build_path) downloader.download_app(app_build_path)
else: else:
app_downloader.download_app(app_build_path, 'flash') downloader.download_app(app_build_path, 'flash')
check_dirs = [f'build_{target}_{config}'] check_dirs = [f'build_{target}_{config}']
else: else:
check_dirs = [] check_dirs = []

View File

@@ -39,6 +39,7 @@ junit_log_passing_tests = False
markers = markers =
temp_skip_ci: mark test to be skipped in CI temp_skip_ci: mark test to be skipped in CI
temp_skip: mark test to be skipped in CI and locally 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 require_elf: mark test to be skipped if no elf file is found
env_markers = env_markers =

View File

@@ -150,6 +150,9 @@ class IdfLocalPlugin:
if 'esp32c2' in case.targets and 'xtal_26mhz' not in case.all_markers: if 'esp32c2' in case.targets and 'xtal_26mhz' not in case.all_markers:
item.add_marker('xtal_40mhz') 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: def pytest_custom_test_case_name(self, item: Function) -> str:
return item.funcargs.get('test_case_name', item.nodeid) # type: ignore return item.funcargs.get('test_case_name', item.nodeid) # type: ignore