def test_combo(self): self.assertTrue(match_run_on_projects('try', ['release', 'try', 'date'])) self.assertFalse(match_run_on_projects('larch', ['release', 'try', 'date'])) self.assertTrue(match_run_on_projects('date', ['release', 'try', 'date'])) self.assertFalse(match_run_on_projects('autoland', ['release', 'try', 'date'])) self.assertFalse(match_run_on_projects('mozilla-inbound', ['release', 'try', 'date'])) self.assertTrue(match_run_on_projects('mozilla-central', ['release', 'try', 'date'])) self.assertTrue(match_run_on_projects('mozilla-aurora', ['release', 'try', 'date'])) self.assertTrue(match_run_on_projects('mozilla-beta', ['release', 'try', 'date'])) self.assertTrue(match_run_on_projects('mozilla-release', ['release', 'try', 'date']))
def split_serviceworker_e10s(config, tests): for test in tests: sw = test.pop('serviceworker-e10s') test['serviceworker-e10s'] = False test['attributes']['serviceworker_e10s'] = False if sw == 'both': yield copy.deepcopy(test) sw = True if sw: if not match_run_on_projects('mozilla-central', test['run-on-projects']): continue test['description'] += " with serviceworker-e10s redesign enabled" test['run-on-projects'] = ['mozilla-central'] test['test-name'] += '-sw' test['try-name'] += '-sw' test['attributes']['serviceworker_e10s'] = True group, symbol = split_symbol(test['treeherder-symbol']) if group != '?': group += '-sw' else: symbol += '-sw' test['treeherder-symbol'] = join_symbol(group, symbol) test['mozharness']['extra-options'].append( '--setpref="dom.serviceWorkers.parent_intercept=true"') yield test
def filter_for_project(task, parameters): """Filter tasks by project. Optionally enable nightlies.""" if task.attributes.get( 'nightly') and not parameters.get('include_nightly'): return False run_on_projects = set(task.attributes.get('run_on_projects', [])) return match_run_on_projects(parameters['project'], run_on_projects)
def test_release(self): self.assertFalse(match_run_on_projects('try', ['release'])) self.assertFalse(match_run_on_projects('larch', ['release'])) self.assertFalse(match_run_on_projects('autoland', ['release'])) self.assertFalse(match_run_on_projects('mozilla-inbound', ['release'])) self.assertTrue(match_run_on_projects('mozilla-central', ['release'])) self.assertTrue(match_run_on_projects('mozilla-aurora', ['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('try', ['integration'])) self.assertFalse(match_run_on_projects('larch', ['integration'])) self.assertTrue(match_run_on_projects('autoland', ['integration'])) self.assertTrue(match_run_on_projects('mozilla-inbound', ['integration'])) self.assertFalse(match_run_on_projects('mozilla-central', ['integration'])) self.assertFalse(match_run_on_projects('mozilla-aurora', ['integration'])) self.assertFalse(match_run_on_projects('mozilla-beta', ['integration'])) self.assertFalse(match_run_on_projects('mozilla-integration', ['integration']))
def test_all(self): self.assertTrue(match_run_on_projects('try', ['all'])) self.assertTrue(match_run_on_projects('larch', ['all'])) self.assertTrue(match_run_on_projects('autoland', ['all'])) self.assertTrue(match_run_on_projects('mozilla-inbound', ['all'])) self.assertTrue(match_run_on_projects('mozilla-central', ['all'])) self.assertTrue(match_run_on_projects('mozilla-aurora', ['all'])) self.assertTrue(match_run_on_projects('mozilla-beta', ['all'])) self.assertTrue(match_run_on_projects('mozilla-release', ['all']))
def should_run(job, params): run_on_projects = job.get('run-on-projects', ['all']) if not match_run_on_projects(params['project'], run_on_projects): return False if not any(match_utc(params, hour=sched.get('hour'), minute=sched.get('minute')) for sched in job.get('when', [])): return False return True
def test_combo(self): self.assertTrue(match_run_on_projects('try', ['release', 'try', 'maple'])) self.assertFalse(match_run_on_projects('larch', ['release', 'try', 'maple'])) self.assertTrue(match_run_on_projects('maple', ['release', 'try', 'maple'])) self.assertFalse(match_run_on_projects('autoland', ['release', 'try', 'maple'])) self.assertTrue(match_run_on_projects('mozilla-central', ['release', 'try', 'maple'])) self.assertTrue(match_run_on_projects('mozilla-beta', ['release', 'try', 'maple'])) self.assertTrue(match_run_on_projects('mozilla-release', ['release', 'try', 'maple']))
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 ) verification.verify(None, graph, scratch_pad=scratch_pad, graph_config=graph_config) return graph_name, graph
def should_remove_task(self, task, params, _): project = params["project"] # Scheduling on a backstop only makes sense on autoland. For other projects, # remove the task if the project matches self.remove_on_projects. if project != 'autoland': return match_run_on_projects(project, self.remove_on_projects) if is_backstop(params, self.push_interval, self.time_interval): return False return True
def should_run(job, params): run_on_projects = job.get('run-on-projects', ['all']) if not match_run_on_projects(params['project'], run_on_projects): return False # Resolve when key here, so we don't require it before we know that we # actually want to run on this branch. resolve_keyed_by(job, 'when', 'Cron job ' + job['name'], project=params['project']) if not any(match_utc(params, sched=sched) for sched in job.get('when', [])): return False return True
def should_run(job, params): run_on_projects = job.get('run-on-projects', ['all']) if not match_run_on_projects(params['project'], run_on_projects): return False # Resolve when key here, so we don't require it before we know that we # actually want to run on this branch. resolve_keyed_by(job, 'when', 'Cron job ' + job['name'], project=params['project']) if not any(match_utc(params, hour=sched.get('hour'), minute=sched.get('minute')) for sched in job.get('when', [])): return False return True
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_all(self): self.assertTrue(match_run_on_projects('try', ['all'])) self.assertTrue(match_run_on_projects('larch', ['all'])) self.assertTrue(match_run_on_projects('autoland', ['all'])) self.assertTrue(match_run_on_projects('mozilla-central', ['all'])) self.assertTrue(match_run_on_projects('mozilla-beta', ['all'])) self.assertTrue(match_run_on_projects('mozilla-release', ['all']))
def test_integration(self): self.assertFalse(match_run_on_projects('try', ['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 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 should_remove_task(self, task, params, _): project = params['project'] pushid = int(params['pushlog_id']) pushdate = int(params['pushdate']) # Scheduling on a backstop only makes sense on autoland. For other projects, # remove the task if the project matches self.remove_on_projects. if project != 'autoland': return match_run_on_projects(project, self.remove_on_projects) # On every Nth push, want to run all tasks. if pushid % self.push_interval == 0: return False # We also want to ensure we run all tasks at least once per N minutes. if self.time_interval > 0 and self.minutes_between_pushes( params["head_repository"], project, pushid, pushdate) >= self.time_interval: return False return True
def filter_for_beta(task): """Filter tasks by project. Optionally enable nightlies.""" run_on_projects = set(task.attributes.get('run_on_projects', [])) return match_run_on_projects('mozilla-beta', run_on_projects)
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)
def test_empty(self): self.assertFalse(match_run_on_projects("birch", []))
def test_empty(self): self.assertFalse(match_run_on_projects('try', []))
def runs_on_central(test): return match_run_on_projects('mozilla-central', test['run-on-projects'])
def filter(task): run_on_projects = set(task.attributes.get('run_on_projects', [])) return match_run_on_projects(parameters['project'], run_on_projects)