Пример #1
0
def test_add_options():
    mach_cmd, metadata, env = get_running_env()
    options = [("one", 1), ("two", 2)]
    add_options(env, options)
    extra = env.get_arg("browsertime-extra-options")
    assert "one=1" in extra
    assert "two=2" in extra
Пример #2
0
def before_runs(env, **kw):
    global build_generator

    add_options(env, COMMON_OPTIONS)
    if build_generator:
        revision, build = next(build_generator)
        env.set_arg("android-install-apk", build)
        env.set_arg("perfherder-prefix", revision)
Пример #3
0
def before_runs(env):
    global next_site
    print("Running before_runs")
    add_options(env, options)

    if next_site:
        test_site = next(next_site)
        print("Next site: %s" % test_site)

        if env.get_arg("android"):
            platform_name = "android"
            app_name = env.get_arg("android-app-name").split(".")[-1]
        else:
            platform_name = platform.system().lower()
            app_name = "firefox"

        name = [
            "mitm6",
            platform_name,
            "gve" if app_name == "geckoview_example" else app_name,
            test_site["name"],
        ]

        recording_file = "%s.zip" % "-".join(name)

        env.set_arg("proxy-mode", "record")
        env.set_arg(
            "proxy-file",
            recording_file,
        )

        add_option(env,
                   "browsertime.url",
                   test_site.get("test_url"),
                   overwrite=True)
        add_option(env, "browsertime.screenshot", "true")
        add_option(env, "browsertime.testName", test_site.get("name"))

        second_url = test_site.get("secondary_url", None)
        if second_url:
            add_option(env, "browsertime.secondary_url", second_url)

        cmds = test_site.get("test_cmds", [])
        if cmds:
            parsed_cmds = [
                ":::".join([str(i) for i in item]) for item in cmds if item
            ]
            add_option(env, "browsertime.commands", ";;;".join(parsed_cmds))

        print("Recording %s to file: %s" %
              (test_site.get("test_url"), recording_file))
Пример #4
0
def before_runs(env, **kw):
    env.set_arg("cycles", len(sites))
    add_options(env, options)
Пример #5
0
def before_runs(env, **kw):
    add_options(env, common_options)