diff --git a/taskcluster/gecko_taskgraph/target_tasks.py b/taskcluster/gecko_taskgraph/target_tasks.py index eac2a50e4013..0dc014ec7ca5 100644 --- a/taskcluster/gecko_taskgraph/target_tasks.py +++ b/taskcluster/gecko_taskgraph/target_tasks.py @@ -308,6 +308,9 @@ def _try_task_config(full_task_graph, parameters, graph_config): ] ) + if "MOZHARNESS_TEST_PATHS" in parameters["try_task_config"].get("env", {}): + matched_tasks = [x for x in matched_tasks if x.endswith("-1")] + return list(set(tasks) | set(matched_tasks)) diff --git a/taskcluster/gecko_taskgraph/test/test_target_tasks.py b/taskcluster/gecko_taskgraph/test/test_target_tasks.py index 2bbc57fcf356..22582f904042 100644 --- a/taskcluster/gecko_taskgraph/test/test_target_tasks.py +++ b/taskcluster/gecko_taskgraph/test/test_target_tasks.py @@ -210,6 +210,21 @@ class TestTargetTasks(unittest.TestCase): } self.assertEqual(sorted(method(tg, params, {})), ["ddd-1", "ddd-2"]) + def test_try_task_config_regex_with_paths(self): + "try_mode = try_task_config uses the try config with regex instead of chunk numbers" + tg = self.make_task_graph() + method = target_tasks.get_method("try_tasks") + params = { + "try_mode": "try_task_config", + "try_task_config": { + "new-test-config": True, + "tasks": ["ddd-*"], + "env": {"MOZHARNESS_TEST_PATHS": "foo/bar"}, + }, + "project": "try", + } + self.assertEqual(sorted(method(tg, params, {})), ["ddd-1"]) + def test_try_task_config_absolute(self): "try_mode = try_task_config uses the try config with full task labels" tg = self.make_task_graph()