Skip to content

Commit 47650d1

Browse files
committed
Check for test existence
If PR change their name chance is that we do not realize it and we don't execute the tests...
1 parent c272ce2 commit 47650d1

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/validation/tests/base.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ class Tests:
1515
test_case_kls: type
1616

1717
def run(self):
18-
logging.info("Run testcases where the build is triggered by a ‹vm-image-build› comment")
1918
prs_for_comment = [
2019
pr for pr in self.project.get_pr_list() if pr.title.startswith("Test VM Image builds")
2120
]
21+
if prs_for_comment:
22+
logging.info("Run testcases where the build is triggered by a ‹vm-image-build› comment")
23+
else:
24+
logging.warning(
25+
"No testcases found where the build is triggered by a ‹vm-image-build› comment",
26+
)
2227
for pr in prs_for_comment:
2328
self.test_case_kls(
2429
project=self.project,
@@ -28,10 +33,13 @@ def run(self):
2833
comment=DEPLOYMENT.pr_comment_vm_image_build,
2934
).run_test()
3035

31-
logging.info("Run testcases where the build is triggered by a ‹build› comment")
3236
prs_for_comment = [
3337
pr for pr in self.project.get_pr_list() if pr.title.startswith("Basic test case:")
3438
]
39+
if prs_for_comment:
40+
logging.info("Run testcases where the build is triggered by a ‹build› comment")
41+
else:
42+
logging.warning("No testcases found where the build is triggered by a ‹build› comment")
3543
for pr in prs_for_comment:
3644
self.test_case_kls(
3745
project=self.project,
@@ -40,12 +48,15 @@ def run(self):
4048
deployment=DEPLOYMENT,
4149
).run_test()
4250

43-
logging.info("Run testcase where the build is triggered by push")
4451
pr_for_push = [
4552
pr
4653
for pr in self.project.get_pr_list()
4754
if pr.title.startswith(DEPLOYMENT.push_trigger_tests_prefix)
4855
]
56+
if pr_for_push:
57+
logging.info("Run testcase where the build is triggered by push")
58+
else:
59+
logging.warning("No testcase found where the build is triggered by push")
4960
if pr_for_push:
5061
self.test_case_kls(
5162
project=self.project,

0 commit comments

Comments
 (0)