diff --git a/e2e/e2e_select.py b/e2e/e2e_select.py index e4a031fd8..394884299 100644 --- a/e2e/e2e_select.py +++ b/e2e/e2e_select.py @@ -107,8 +107,9 @@ def select(paths): continue if path.startswith("e2e/") and path.endswith("_test.py"): name = Path(path).name - candidates[name] = f"changed {path}" - must_keep.add(name) + if (E2E / name).is_file(): + candidates[name] = f"changed {path}" + must_keep.add(name) continue for pattern, files in rules.items(): if fnmatch.fnmatch(path, pattern): diff --git a/test/harness/e2e_selection_test.py b/test/harness/e2e_selection_test.py index 96487ab45..0735fbc8d 100644 --- a/test/harness/e2e_selection_test.py +++ b/test/harness/e2e_selection_test.py @@ -35,3 +35,7 @@ class E2ESelectionTests(unittest.TestCase): selected, _ = e2e_select.select(["misc/schedule.gleam"]) self.assertIn(smoke, selected) self.assertIn(optional, selected) + + def test_deleted_test_file_is_not_requested_from_runner(self): + selected, _ = e2e_select.select(["e2e/retired_scenario_test.py"]) + self.assertNotIn("retired_scenario_test.py", selected)