Skip to content

Commit 76181e5

Browse files
committed
ci: skip app downloader for host test cases
1 parent 158eb78 commit 76181e5

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

.gitlab/ci/host-test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,11 @@ test_pytest_qemu:
300300
- run_cmd idf-ci build run
301301
--build-system cmake
302302
--target $IDF_TARGET
303-
--only-test-related
304303
-m qemu
305304
--modified-files ${MR_MODIFIED_FILES}
306305
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
307306
- run_cmd pytest
308307
--target $IDF_TARGET
309-
--log-cli-level DEBUG
310308
-m qemu
311309
--embedded-services idf,qemu
312310
--junitxml=XUNIT_RESULT.xml

conftest.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,19 @@ def build_dir(
300300
"""
301301
# download from minio on CI
302302
case: PytestCase = request.node.stash[IDF_CI_PYTEST_CASE_KEY]
303-
if app_downloader:
303+
if 'skip_app_downloader' in case.all_markers:
304+
logging.debug('skip_app_downloader marker found, skip downloading app')
305+
downloader = None
306+
else:
307+
downloader = app_downloader
308+
309+
if downloader:
304310
# somehow hardcoded...
305311
app_build_path = os.path.join(idf_relpath(app_path), f'build_{target}_{config}')
306312
if requires_elf_or_map(case):
307-
app_downloader.download_app(app_build_path)
313+
downloader.download_app(app_build_path)
308314
else:
309-
app_downloader.download_app(app_build_path, 'flash')
315+
downloader.download_app(app_build_path, 'flash')
310316
check_dirs = [f'build_{target}_{config}']
311317
else:
312318
check_dirs = []

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ junit_log_passing_tests = False
3939
markers =
4040
temp_skip_ci: mark test to be skipped in CI
4141
temp_skip: mark test to be skipped in CI and locally
42+
skip_app_downloader: mark test required apps built locally, not downloaded from CI
4243
require_elf: mark test to be skipped if no elf file is found
4344

4445
env_markers =

tools/ci/idf_pytest/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ def pytest_collection_modifyitems(self, config: Config, items: t.List[Function])
150150
if 'esp32c2' in case.targets and 'xtal_26mhz' not in case.all_markers:
151151
item.add_marker('xtal_40mhz')
152152

153+
if 'host_test' in case.all_markers:
154+
item.add_marker('skip_app_downloader') # host_test jobs will build the apps itself
155+
153156
def pytest_custom_test_case_name(self, item: Function) -> str:
154157
return item.funcargs.get('test_case_name', item.nodeid) # type: ignore
155158

0 commit comments

Comments
 (0)