Пример #1
0
def resolve_keyed_by(config, tests):
    """Resolve fields that can be keyed by platform, etc."""
    fields = [
        'instance-size',
        'max-run-time',
        'chunks',
        'e10s',
        'suite',
        'run-on-projects',
        'tier',
    ]
    for test in tests:
        for field in fields:
            test[field] = get_keyed_by(item=test,
                                       field=field,
                                       item_name=test['test-name'])
        test['mozharness']['config'] = get_keyed_by(
            item=test,
            field='mozharness',
            subfield='config',
            item_name=test['test-name'])
        test['mozharness']['extra-options'] = get_keyed_by(
            item=test,
            field='mozharness',
            subfield='extra-options',
            item_name=test['test-name'])
        yield test
Пример #2
0
def split_e10s(config, tests):
    for test in tests:
        e10s = get_keyed_by(item=test,
                            field='e10s',
                            item_name=test['test-name'])
        test.setdefault('attributes', {})
        test['e10s'] = False
        test['attributes']['e10s'] = False

        if e10s == 'both':
            yield copy.deepcopy(test)
            e10s = True
        if e10s:
            test['test-name'] += '-e10s'
            test['e10s'] = True
            test['attributes']['e10s'] = True
            group, symbol = split_symbol(test['treeherder-symbol'])
            if group != '?':
                group += '-e10s'
            test['treeherder-symbol'] = join_symbol(group, symbol)
            test['mozharness']['extra-options'] = get_keyed_by(
                item=test,
                field='mozharness',
                subfield='extra-options',
                item_name=test['test-name'])
            test['mozharness']['extra-options'].append('--e10s')
        yield test
Пример #3
0
def resolve_keyed_by(config, tests):
    """Resolve fields that can be keyed by platform, etc."""
    fields = [
        'instance-size',
        'max-run-time',
        'chunks',
    ]
    for test in tests:
        for field in fields:
            test[field] = get_keyed_by(item=test, field=field, item_name=test['test-name'])
        test['mozharness']['config'] = get_keyed_by(item=test,
                                                    field='mozharness',
                                                    subfield='config',
                                                    item_name=test['test-name'])
        yield test
Пример #4
0
def add_os_groups(config, tests):
    for test in tests:
        if test['test-platform'].startswith('win'):
            groups = get_keyed_by(item=test, field='os-groups', item_name=test['test-name'])
            if groups:
                test['os-groups'] = groups
        yield test
Пример #5
0
def add_os_groups(config, tests):
    for test in tests:
        if test["test-platform"].startswith("win"):
            groups = get_keyed_by(item=test, field="os-groups", item_name=test["test-name"])
            if groups:
                test["os-groups"] = groups
        yield test
Пример #6
0
 def test_by_value_no_by(self):
     test = {
         'test-name': 'tname',
         'option': {
             'other-value': {},
         },
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), test['option'])
Пример #7
0
 def test_by_value_no_by(self):
     test = {
         'test-name': 'tname',
         'option': {
             'other-value': {},
         },
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), test['option'])
Пример #8
0
 def test_by_value_dict(self):
     test = {
         'test-name': 'tname',
         'option': {
             'by-something-else': {},
             'by-other-value': {},
         },
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), test['option'])
Пример #9
0
def add_os_groups(config, tests):
    for test in tests:
        if test['test-platform'].startswith('win'):
            groups = get_keyed_by(item=test,
                                  field='os-groups',
                                  item_name=test['test-name'])
            if groups:
                test['os-groups'] = groups
        yield test
Пример #10
0
 def test_by_value_dict(self):
     test = {
         'test-name': 'tname',
         'option': {
             'by-something-else': {},
             'by-other-value': {},
         },
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), test['option'])
Пример #11
0
def resolve_keyed_by(config, jobs):
    fields = [
        'worker-type',
        'worker',
    ]

    for job in jobs:
        for field in fields:
            job[field] = get_keyed_by(item=job, field=field, item_name=job['name'])
        yield job
Пример #12
0
 def test_by_value_default(self):
     test = {
         'test-name': 'tname',
         'option': {
             'by-other-value': {
                 'a': 10,
                 'default': 30,
             },
         },
         'other-value': 'xxx',
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), 30)
Пример #13
0
def resolve_keyed_by(config, jobs):
    fields = [
        'worker-type',
        'worker',
    ]

    for job in jobs:
        for field in fields:
            job[field] = get_keyed_by(item=job,
                                      field=field,
                                      item_name=job['name'])
        yield job
Пример #14
0
 def test_by_value_default(self):
     test = {
         'test-name': 'tname',
         'option': {
             'by-other-value': {
                 'a': 10,
                 'default': 30,
             },
         },
         'other-value': 'xxx',
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), 30)
Пример #15
0
 def test_by_value(self):
     test = {
         'test-name': 'tname',
         'option': {
             'by-other-value': {
                 'a': 10,
                 'b': 20,
             },
         },
         'other-value': 'b',
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), 20)
Пример #16
0
 def test_by_value(self):
     test = {
         'test-name': 'tname',
         'option': {
             'by-other-value': {
                 'a': 10,
                 'b': 20,
             },
         },
         'other-value': 'b',
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), 20)
Пример #17
0
 def test_by_value_regex(self):
     test = {
         'test-name': 'tname',
         'option': {
             'by-test-platform': {
                 'macosx64/.*': 10,
                 'linux64/debug': 20,
                 'default': 5,
             },
         },
         'test-platform': 'macosx64/debug',
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), 10)
Пример #18
0
def allow_software_gl_layers(config, tests):
    for test in tests:
        allow = get_keyed_by(item=test, field='allow-software-gl-layers',
                             item_name=test['test-name'])
        if allow:
            assert test['instance-size'] != 'legacy',\
                   'Software GL layers on a legacy instance is disallowed (bug 1296086).'

            # This should be set always once bug 1296086 is resolved.
            test['mozharness'].setdefault('extra-options', [])\
                              .append("--allow-software-gl-layers")

        yield test
Пример #19
0
 def test_by_value_regex(self):
     test = {
         'test-name': 'tname',
         'option': {
             'by-test-platform': {
                 'macosx64/.*': 10,
                 'linux64/debug': 20,
                 'default': 5,
             },
         },
         'test-platform': 'macosx64/debug',
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), 10)
Пример #20
0
def resolve_keyed_by(config, tests):
    """Resolve fields that can be keyed by platform, etc."""
    fields = [
        'instance-size',
        'max-run-time',
        'chunks',
    ]
    for test in tests:
        for field in fields:
            test[field] = get_keyed_by(item=test,
                                       field=field,
                                       item_name=test['test-name'])
        yield test
Пример #21
0
def allow_software_gl_layers(config, tests):
    for test in tests:

        # since this value defaults to true, but is not applicable on non-linux,
        # it's overriden for that platform here.
        allow = test['test-platform'].startswith('linux') \
            and get_keyed_by(item=test, field='allow-software-gl-layers',
                             item_name=test['test-name'])
        if allow:
            assert test['instance-size'] != 'legacy',\
                   'Software GL layers on a legacy instance is disallowed (bug 1296086).'

            # This should be set always once bug 1296086 is resolved.
            test['mozharness'].setdefault('extra-options', [])\
                              .append("--allow-software-gl-layers")

        yield test
Пример #22
0
def allow_software_gl_layers(config, tests):
    for test in tests:

        # since this value defaults to true, but is not applicable on windows,
        # it's overriden for that platform here.
        allow = not test["test-platform"].startswith("win") and get_keyed_by(
            item=test, field="allow-software-gl-layers", item_name=test["test-name"]
        )
        if allow:
            assert (
                test["instance-size"] != "legacy"
            ), "Software GL layers on a legacy instance is disallowed (bug 1296086)."

            # This should be set always once bug 1296086 is resolved.
            test["mozharness"].setdefault("extra-options", []).append("--allow-software-gl-layers")

        yield test
Пример #23
0
def allow_software_gl_layers(config, tests):
    for test in tests:

        # since this value defaults to true, but is not applicable on windows,
        # it's overriden for that platform here.
        allow = not test['test-platform'].startswith('win') \
            and get_keyed_by(item=test, field='allow-software-gl-layers',
                             item_name=test['test-name'])
        if allow:
            assert test['instance-size'] != 'legacy',\
                   'Software GL layers on a legacy instance is disallowed (bug 1296086).'

            # This should be set always once bug 1296086 is resolved.
            test['mozharness'].setdefault('extra-options', [])\
                              .append("--allow-software-gl-layers")

        yield test
Пример #24
0
def split_e10s(config, tests):
    for test in tests:
        e10s = get_keyed_by(item=test, field="e10s", item_name=test["test-name"])
        test.setdefault("attributes", {})
        test["e10s"] = False
        test["attributes"]["e10s"] = False

        if e10s == "both":
            yield test
            test = copy.deepcopy(test)
            e10s = True
        if e10s:
            test["test-name"] += "-e10s"
            test["e10s"] = True
            test["attributes"]["e10s"] = True
            group, symbol = split_symbol(test["treeherder-symbol"])
            if group != "?":
                group += "-e10s"
            test["treeherder-symbol"] = join_symbol(group, symbol)
            test["mozharness"].setdefault("extra-options", []).append("--e10s")
        yield test
Пример #25
0
def split_e10s(config, tests):
    for test in tests:
        e10s = get_keyed_by(item=test, field='e10s',
                            item_name=test['test-name'])
        test.setdefault('attributes', {})
        test['e10s'] = False
        test['attributes']['e10s'] = False

        if e10s == 'both':
            yield test
            test = copy.deepcopy(test)
            e10s = True
        if e10s:
            test['test-name'] += '-e10s'
            test['e10s'] = True
            test['attributes']['e10s'] = True
            group, symbol = split_symbol(test['treeherder-symbol'])
            if group != '?':
                group += '-e10s'
            test['treeherder-symbol'] = join_symbol(group, symbol)
            test['mozharness'].setdefault('extra-options', []).append('--e10s')
        yield test
Пример #26
0
 def test_simple_value(self):
     test = {
         'test-name': 'tname',
         'option': 10,
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), 10)
Пример #27
0
 def test_simple_value(self):
     test = {
         'test-name': 'tname',
         'option': 10,
     }
     self.assertEqual(get_keyed_by(test, 'option', 'x'), 10)