Beispiel #1
0
def get_loader(test_paths, product, ssl_env, debug=None, run_info_extras=None, **kwargs):
    if run_info_extras is None:
        run_info_extras = {}

    run_info = wpttest.get_run_info(kwargs["run_info"], product,
                                    browser_version=kwargs.get("browser_version"),
                                    debug=debug,
                                    extras=run_info_extras)

    test_manifests = testloader.ManifestLoader(test_paths, force_manifest_update=kwargs["manifest_update"],
                                               manifest_download=kwargs["manifest_download"]).load()

    manifest_filters = []
    meta_filters = []

    if kwargs["include"] or kwargs["exclude"] or kwargs["include_manifest"]:
        manifest_filters.append(testloader.TestFilter(include=kwargs["include"],
                                                      exclude=kwargs["exclude"],
                                                      manifest_path=kwargs["include_manifest"],
                                                      test_manifests=test_manifests))
    if kwargs["tags"]:
        meta_filters.append(testloader.TagFilter(tags=kwargs["tags"]))

    test_loader = testloader.TestLoader(test_manifests,
                                        kwargs["test_types"],
                                        run_info,
                                        manifest_filters=manifest_filters,
                                        meta_filters=meta_filters,
                                        chunk_type=kwargs["chunk_type"],
                                        total_chunks=kwargs["total_chunks"],
                                        chunk_number=kwargs["this_chunk"],
                                        include_https=ssl_env.ssl_enabled,
                                        skip_timeout=kwargs["skip_timeout"])
    return run_info, test_loader
Beispiel #2
0
def sync_tests(paths, local_tree, wpt, bug):
    wpt.update()

    do_delayed_imports(paths["sync"])

    try:
        #bug.comment("Updating to %s" % wpt.rev)
        sync_paths = {"/": {"tests_path": paths["sync"],
                            "metadata_path": paths["sync_dest"]["metadata_path"]}}

        manifest_loader = testloader.ManifestLoader(sync_paths)
        initial_manifests = manifest_loader.load()
        wpt.copy_work_tree(paths["sync_dest"]["tests_path"])

        local_tree.create_patch("web-platform-tests_update_%s" % wpt.rev,
                                "Update web-platform-tests to revision %s" % wpt.rev)
        local_tree.add_new(os.path.relpath(paths["sync_dest"]["tests_path"],
                                           local_tree.root))
        local_tree.update_patch(include=[paths["sync_dest"]["tests_path"],
                                         paths["sync_dest"]["metadata_path"]])
    except Exception as e:
        #bug.comment("Update failed with error:\n %s" % traceback.format_exc())
        sys.stderr.write(traceback.format_exc())
        raise
    finally:
        pass  # wpt.clean()

    return initial_manifests
Beispiel #3
0
def get_loader(test_paths, product, ssl_env, debug=None, **kwargs):
    run_info = wpttest.get_run_info(kwargs["run_info"], product, debug=debug)

    test_manifests = testloader.ManifestLoader(
        test_paths, force_manifest_update=kwargs["manifest_update"]).load()

    manifest_filters = []
    meta_filters = []

    if kwargs["include"] or kwargs["exclude"] or kwargs["include_manifest"]:
        manifest_filters.append(
            testloader.TestFilter(include=kwargs["include"],
                                  exclude=kwargs["exclude"],
                                  manifest_path=kwargs["include_manifest"],
                                  test_manifests=test_manifests))
    if kwargs["tags"]:
        meta_filters.append(testloader.TagFilter(tags=kwargs["tags"]))

    test_loader = testloader.TestLoader(test_manifests,
                                        kwargs["test_types"],
                                        run_info,
                                        manifest_filters=manifest_filters,
                                        meta_filters=meta_filters,
                                        chunk_type=kwargs["chunk_type"],
                                        total_chunks=kwargs["total_chunks"],
                                        chunk_number=kwargs["this_chunk"],
                                        include_https=ssl_env.ssl_enabled)
    return run_info, test_loader
Beispiel #4
0
def load_test_data(test_paths):
    manifest_loader = testloader.ManifestLoader(test_paths, False)
    manifests = manifest_loader.load()

    id_test_map = {}
    for test_manifest, paths in manifests.iteritems():
        id_test_map.update(
            create_test_tree(paths["metadata_path"], test_manifest))
    return id_test_map
Beispiel #5
0
def get_loader(test_paths,
               product,
               debug=None,
               run_info_extras=None,
               **kwargs):
    if run_info_extras is None:
        run_info_extras = {}

    run_info = wpttest.get_run_info(
        kwargs["run_info"],
        product,
        browser_version=kwargs.get("browser_version"),
        browser_channel=kwargs.get("browser_channel"),
        verify=kwargs.get("verify"),
        debug=debug,
        extras=run_info_extras,
        enable_webrender=kwargs.get("enable_webrender"))

    test_manifests = testloader.ManifestLoader(
        test_paths,
        force_manifest_update=kwargs["manifest_update"],
        manifest_download=kwargs["manifest_download"]).load()

    manifest_filters = []

    if kwargs["include"] or kwargs["exclude"] or kwargs[
            "include_manifest"] or kwargs["default_exclude"]:
        manifest_filters.append(
            testloader.TestFilter(include=kwargs["include"],
                                  exclude=kwargs["exclude"],
                                  manifest_path=kwargs["include_manifest"],
                                  test_manifests=test_manifests,
                                  explicit=kwargs["default_exclude"]))

    ssl_enabled = sslutils.get_cls(kwargs["ssl_type"]).ssl_enabled
    test_loader = testloader.TestLoader(test_manifests,
                                        kwargs["test_types"],
                                        run_info,
                                        manifest_filters=manifest_filters,
                                        chunk_type=kwargs["chunk_type"],
                                        total_chunks=kwargs["total_chunks"],
                                        chunk_number=kwargs["this_chunk"],
                                        include_https=ssl_enabled,
                                        skip_timeout=kwargs["skip_timeout"])
    return run_info, test_loader
Beispiel #6
0
def get_loader(test_paths, product, ssl_env, debug=False, **kwargs):
    run_info = wpttest.get_run_info(kwargs["run_info"], product, debug=debug)

    test_manifests = testloader.ManifestLoader(
        test_paths, force_manifest_update=kwargs["manifest_update"]).load()

    test_filter = testloader.TestFilter(
        include=kwargs["include"],
        exclude=kwargs["exclude"],
        manifest_path=kwargs["include_manifest"],
        test_manifests=test_manifests)

    test_loader = testloader.TestLoader(test_manifests,
                                        kwargs["test_types"],
                                        test_filter,
                                        run_info,
                                        chunk_type=kwargs["chunk_type"],
                                        total_chunks=kwargs["total_chunks"],
                                        chunk_number=kwargs["this_chunk"],
                                        include_https=ssl_env.ssl_enabled)
    return run_info, test_loader
Beispiel #7
0
def load_test_manifests(serve_root, test_paths):
    do_delayed_imports(serve_root)
    manifest_loader = testloader.ManifestLoader(test_paths, False)
    return manifest_loader.load()