From 55870f379d7b5d72e32bb563482b8b3bdfffb605 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Sun, 23 Apr 2023 14:49:27 +0800 Subject: [PATCH] ci: fix build script when no test script found --- tools/ci/idf_ci_utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/ci/idf_ci_utils.py b/tools/ci/idf_ci_utils.py index d8c0b78f05..6bd4a45d49 100644 --- a/tools/ci/idf_ci_utils.py +++ b/tools/ci/idf_ci_utils.py @@ -248,13 +248,18 @@ def get_pytest_cases( # collect all cases os.environ['INCLUDE_NIGHTLY_RUN'] = '1' - cases = [] + cases = [] # type: List[PytestCase] + pytest_scripts = get_pytest_files(paths) + if not pytest_scripts: + print(f'WARNING: no pytest scripts found for target {target} under paths {", ".join(paths)}') + return cases + for target in targets: collector = PytestCollectPlugin(target) with io.StringIO() as buf: with redirect_stdout(buf): - cmd = ['--collect-only', *get_pytest_files(paths), '--target', target, '-q'] + cmd = ['--collect-only', *pytest_scripts, '--target', target, '-q'] if marker_expr: cmd.extend(['-m', marker_expr]) if filter_expr: