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']))
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
 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']))
Ejemplo n.º 7
0
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
Ejemplo n.º 8
0
 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']))
Ejemplo n.º 9
0
 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
Ejemplo n.º 10
0
    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
Ejemplo n.º 11
0
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
Ejemplo n.º 12
0
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
Ejemplo n.º 13
0
 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"]))
Ejemplo n.º 14
0
 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']))
Ejemplo n.º 15
0
 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']))
Ejemplo n.º 16
0
 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"]))
Ejemplo n.º 17
0
    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
Ejemplo n.º 18
0
 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)
Ejemplo n.º 19
0
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)
Ejemplo n.º 20
0
 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)
Ejemplo n.º 21
0
 def test_empty(self):
     self.assertFalse(match_run_on_projects("birch", []))
Ejemplo n.º 22
0
 def test_empty(self):
     self.assertFalse(match_run_on_projects('try', []))
Ejemplo n.º 23
0
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)
Ejemplo n.º 24
0
 def test_empty(self):
     self.assertFalse(match_run_on_projects('try', []))
Ejemplo n.º 25
0
def runs_on_central(test):
    return match_run_on_projects('mozilla-central', test['run-on-projects'])
Ejemplo n.º 26
0
 def filter(task):
     run_on_projects = set(task.attributes.get('run_on_projects', []))
     return match_run_on_projects(parameters['project'], run_on_projects)