def test_release(self): self.assertFalse(match_run_on_projects("birch", ["release"])) self.assertFalse(match_run_on_projects("larch", ["release"])) self.assertFalse(match_run_on_projects("autoland", ["release"])) self.assertTrue(match_run_on_projects("mozilla-central", ["release"])) self.assertTrue(match_run_on_projects("mozilla-beta", ["release"])) self.assertTrue(match_run_on_projects("mozilla-release", ["release"]))
def test_integration(self): self.assertFalse(match_run_on_projects("birch", ["integration"])) self.assertFalse(match_run_on_projects("larch", ["integration"])) self.assertTrue(match_run_on_projects("autoland", ["integration"])) self.assertFalse( match_run_on_projects("mozilla-central", ["integration"])) self.assertFalse(match_run_on_projects("mozilla-beta", ["integration"])) self.assertFalse( match_run_on_projects("mozilla-integration", ["integration"]))
def __call__(self, graph_name, graph, graph_config, parameters): for verification in self._verifications.get(graph_name, []): if not match_run_on_projects(parameters["project"], verification.run_on_projects): continue scratch_pad = {} graph.for_each_task( verification.verify, scratch_pad=scratch_pad, graph_config=graph_config, parameters=parameters, ) verification.verify( None, graph, scratch_pad=scratch_pad, graph_config=graph_config, parameters=parameters, ) return graph_name, graph
def test_empty(self): self.assertFalse(match_run_on_projects("birch", []))
def filter_for_project(task, parameters): """Filter tasks by project. Optionally enable nightlies.""" run_on_projects = set(task.attributes.get("run_on_projects", [])) return match_run_on_projects(parameters["project"], run_on_projects)
def filter_for_target_project(task): """Filter tasks by project. Optionally enable nightlies.""" run_on_projects = set(task.attributes.get("run_on_projects", [])) return match_run_on_projects(target_project, run_on_projects)