Beispiel #1
0
def test_chunk_manifests(suite, platform, chunks, mock_mozinfo):
    """Tests chunking with real manifests."""
    mozinfo = mock_mozinfo(*platform)

    loader = chunking.DefaultLoader([])
    manifests = loader.get_manifests(suite, frozenset(mozinfo.items()))

    chunked_manifests = chunking.chunk_manifests(suite, platform, chunks,
                                                 manifests["active"])

    # Assertions and end test.
    assert chunked_manifests
    assert len(chunked_manifests) == chunks
    assert all(chunked_manifests)
Beispiel #2
0
def test_get_manifests(suite, platform, mock_mozinfo):
    """Tests the DefaultLoader class' ability to load manifests."""
    mozinfo = mock_mozinfo(*platform)

    loader = chunking.DefaultLoader([])
    manifests = loader.get_manifests(suite, frozenset(mozinfo.items()))

    assert manifests
    assert manifests["active"]
    if "web-platform" in suite:
        assert manifests["skipped"] == []
    else:
        assert manifests["skipped"]

    items = manifests["active"]
    if suite == "xpcshell":
        assert all([re.search(r"xpcshell(.*)?.ini", m) for m in items])
    if "mochitest" in suite:
        assert all(
            [re.search(r"(mochitest|chrome|browser).*.ini", m) for m in items])
    if "web-platform" in suite:
        assert all([m.startswith("/") and m.count("/") <= 4 for m in items])
def test_get_manifests(suite, platform, mock_mozinfo):
    """Tests the DefaultLoader class' ability to load manifests.
    """
    mozinfo = mock_mozinfo(*platform)

    loader = chunking.DefaultLoader([])
    manifests = loader.get_manifests(suite, frozenset(mozinfo.items()))

    assert manifests
    assert manifests['active']
    if 'web-platform' in suite:
        assert manifests['skipped'] == []
    else:
        assert manifests['skipped']

    items = manifests['active']
    if suite == 'xpcshell':
        assert all([re.search(r'xpcshell(.*)?.ini', m) for m in items])
    if 'mochitest' in suite:
        assert all([re.search(r'(mochitest|chrome|browser).*.ini', m) for m in items])
    if 'web-platform' in suite:
        assert all([m.startswith('/') and m.count('/') <= 4 for m in items])