Пример #1
0
def all_suites(patch_resolver):
    from moztest.resolve import _test_flavors, _test_subsuites
    all_suites = []
    for flavor in _test_flavors:
        all_suites.append({'flavor': flavor, 'srcdir_relpath': 'test'})

    for flavor, subsuite in _test_subsuites:
        all_suites.append({'flavor': flavor, 'subsuite': subsuite, 'srcdir_relpath': 'test'})

    patch_resolver([], all_suites)
    return resolve_tests_by_suite(['test'])
Пример #2
0
def test_suites(item, patch_resolver, all_suites):
    """An integration test to make sure the suites returned by
    `tasks.resolve_tests_by_suite` match up with the names defined in
    mozharness.
    """
    patch_resolver([], all_suites)
    suites = resolve_tests_by_suite(["test"])
    os.environ["MOZHARNESS_TEST_PATHS"] = json.dumps(suites)

    name, suite = item
    func = get_mozharness_test_paths(name)
    assert func(*suite)
Пример #3
0
def test_resolve_tests_by_suite(patch_resolver):
    patch_resolver([], [{
        "flavor": "xpcshell",
        "srcdir_relpath": "xpcshell.js"
    }])
    assert resolve_tests_by_suite(["xpcshell.js"]) == {
        "xpcshell": ["xpcshell.js"],
    }

    patch_resolver(
        [],
        [
            {
                "flavor": "xpcshell",
                "srcdir_relpath": "xpcshell.js",
                "manifest_relpath": "xpcshell.ini",
            },
        ],
    )
    assert resolve_tests_by_suite(["xpcshell.ini"]) == {
        "xpcshell": ["xpcshell.ini"],
    }

    patch_resolver(
        [],
        [
            {
                "flavor": "xpcshell",
                "srcdir_relpath": "xpcshell.js"
            },
            {
                "flavor": "mochitest",
                "srcdir_relpath": "mochitest.js"
            },
        ],
    )
    assert resolve_tests_by_suite(["xpcshell.js", "mochitest.js"]) == {
        "xpcshell": ["xpcshell.js"],
        "mochitest-plain": ["mochitest.js"],
    }
Пример #4
0
def test_resolve_tests_by_suite(patch_resolver):
    patch_resolver([], [{
        'flavor': 'xpcshell',
        'srcdir_relpath': 'xpcshell.js'
    }])
    assert resolve_tests_by_suite(['xpcshell.js']) == {
        'xpcshell': ['xpcshell.js'],
    }

    patch_resolver([], [
        {
            'flavor': 'xpcshell',
            'srcdir_relpath': 'xpcshell.js'
        },
        {
            'flavor': 'mochitest',
            'srcdir_relpath': 'mochitest.js'
        },
    ])
    assert resolve_tests_by_suite(['xpcshell.js', 'mochitest.js']) == {
        'xpcshell': ['xpcshell.js'],
        'plain': ['mochitest.js'],
    }