From 9fef652859868b08de300a2b758f4c66242fafdc Mon Sep 17 00:00:00 2001 From: lruzicki Date: Fri, 6 Oct 2023 14:05:43 +0200 Subject: [PATCH 1/2] lruzicki/hotfix: refine list_test_executions to handle non-directory paths and improve validation --- src/templates/generate-config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/templates/generate-config.py b/src/templates/generate-config.py index 63c8761..50602d9 100644 --- a/src/templates/generate-config.py +++ b/src/templates/generate-config.py @@ -23,6 +23,9 @@ def is_valid(test_harness_path): If shell script is not provided given entity is excluded from test harness. """ + if not os.path.isdir(test_harness_path): + return False + elements = [os.path.basename(name) for name in os.listdir(test_harness_path)] if 'test_entrypoint.sh' not in elements: return False @@ -49,14 +52,14 @@ def app_and_name_from_path(test_harness_path): def list_test_executions(example_apps, versions): test_executions = [] for app, version in itertools.product(example_apps, versions): - if not is_valid(app): + if not os.path.isdir(app) or not is_valid(app): print(f"---\nApp: {app}\nwill not be executed.\ntest_entrypoint.sh is missing.\n---") continue suites_for_version = list_test_suites_for_version(version) for suite in suites_for_version: suite_path = os.path.join(test_suites_path, suite) - if not os.path.exists(suite_path) or not is_valid(suite_path): + if not os.path.exists(suite_path) or not os.path.isdir(suite_path) or not is_valid(suite_path): print(f"---\nTest Suite: {suite}\nwill not be executed.\ntest_entrypoint.sh is missing.\n---") continue From 9ad3615108f1599ebaee055b320c708ef22dcf22 Mon Sep 17 00:00:00 2001 From: lruzicki Date: Fri, 6 Oct 2023 14:12:07 +0200 Subject: [PATCH 2/2] added check to is_valid fun --- src/templates/generate-config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templates/generate-config.py b/src/templates/generate-config.py index 50602d9..fbc7e47 100644 --- a/src/templates/generate-config.py +++ b/src/templates/generate-config.py @@ -52,14 +52,14 @@ def app_and_name_from_path(test_harness_path): def list_test_executions(example_apps, versions): test_executions = [] for app, version in itertools.product(example_apps, versions): - if not os.path.isdir(app) or not is_valid(app): + if not is_valid(app): print(f"---\nApp: {app}\nwill not be executed.\ntest_entrypoint.sh is missing.\n---") continue suites_for_version = list_test_suites_for_version(version) for suite in suites_for_version: suite_path = os.path.join(test_suites_path, suite) - if not os.path.exists(suite_path) or not os.path.isdir(suite_path) or not is_valid(suite_path): + if not os.path.exists(suite_path) or not is_valid(suite_path): print(f"---\nTest Suite: {suite}\nwill not be executed.\ntest_entrypoint.sh is missing.\n---") continue