Skip to content

Commit 2bc506d

Browse files
Make sure init tests are also skipped if the test should be skipped (#45099)
### What does this PR do? Update the dynamic tests for init job, to make sure that they are skipped if the main test would be skipped. Without that change we can have the EKS cluster being initialized, and then being leaked because the test is never executed to call the tear down of the cluster. ### Motivation Avoid unnecessary steps in the CI, and prevent leaking EKS cluster ### Describe how you validated your changes ### Additional Notes Co-authored-by: kevin.fairise <kevin.fairise@datadoghq.com>
1 parent 5d1152d commit 2bc506d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tasks/new_e2e_tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ def run(
294294
changed_files = get_modified_files(ctx)
295295
changed_packages = list({os.path.dirname(change) for change in changed_files})
296296
print(color_message(f"The following changes were detected: {changed_files}", "yellow"))
297-
to_skip = executor.tests_to_skip(os.getenv("CI_JOB_NAME"), changed_packages + changed_files)
297+
test_job_name = os.getenv("CI_JOB_NAME")
298+
if test_job_name.endswith("-init"):
299+
test_job_name = test_job_name.removesuffix("-init")
300+
to_skip = executor.tests_to_skip(test_job_name, changed_packages + changed_files)
298301
ctx.run(f"datadog-ci measure --level job --measures 'e2e.skipped_tests:{len(to_skip)}'", warn=True)
299302
print(color_message(f"The following tests will be skipped: {to_skip}", "yellow"))
300303
skip.extend(to_skip)

0 commit comments

Comments
 (0)