コード例 #1
0
def test_get_task_server(nightly_config, scopes, expected, raises):
    task = get_task(nightly_config)
    task["scopes"] = scopes

    if raises:
        with pytest.raises(ValueError):
            get_task_server(task, nightly_config)
    else:
        assert expected == get_task_server(task, nightly_config)
コード例 #2
0
def test_get_task_server(nightly_config, scopes, expected, raises):
    task = get_task(nightly_config)
    task['scopes'] = scopes

    if raises:
        with pytest.raises(ValueError):
            get_task_server(task, nightly_config)
    else:
        assert expected == get_task_server(task, nightly_config)
コード例 #3
0
ファイル: script.py プロジェクト: MihaiTabara/balrogscript
def main(name=None, config_path=None):
    if name not in (None, '__main__'):
        return

    config = setup_config(config_path)
    setup_logging(config['verbose'])

    task = get_task(config)
    validate_task_schema(config, task)

    server = get_task_server(task, config)
    balrog_auth, config = update_config(config, server)

    config['upstream_artifacts'] = get_upstream_artifacts(task)

    # hacking the tools repo dependency by first reading its location from
    # the config file and only then loading the module from subdfolder
    sys.path.insert(0, os.path.join(config['tools_location'], 'lib/python'))
    # Until we get rid of our tools dep, this import(s) will break flake8 E402
    from util.retry import retry  # noqa: E402

    # Read the manifest from disk
    manifest = get_manifest(config)

    for e in manifest:
        # Get release metadata from manifest
        submitter, release = create_submitter(e, balrog_auth, config)
        # Connect to balrog and submit the metadata
        retry(lambda: submitter.run(**release))
コード例 #4
0
def main(config_path=None):
    config = setup_config(config_path)
    setup_logging(config['verbose'])

    task = get_task(config)
    action = get_task_action(task, config)
    validate_task_schema(config, task, action)

    server = get_task_server(task, config)
    balrog_auth, config = update_config(config, server)

    if action == 'submit-toplevel':
        submit_toplevel(task, config, balrog_auth)
    elif action == 'schedule':
        schedule(task, config, balrog_auth)
    else:
        submit_locale(task, config, balrog_auth)
コード例 #5
0
ファイル: script.py プロジェクト: Callek/scriptworker-scripts
def main(config_path=None):
    # TODO use scriptworker's sync_main(...)
    config = setup_config(config_path)
    setup_logging(config['verbose'])

    task = get_task(config)
    action = get_task_action(task, config)
    validate_task_schema(config, task, action)

    server = get_task_server(task, config)
    auth0_secrets, config = update_config(config, server)

    if action == 'submit-toplevel':
        submit_toplevel(task, config, auth0_secrets)
    elif action == 'schedule':
        schedule(task, config, auth0_secrets)
    else:
        submit_locale(task, config, auth0_secrets)
コード例 #6
0
def main(config_path=None):
    config = setup_config(config_path)
    setup_logging(config['verbose'])

    task = get_task(config)
    action = get_task_action(task, config)
    validate_task_schema(config, task, action)

    server = get_task_server(task, config)
    balrog_auth, config = update_config(config, server)

    # hacking the tools repo dependency by first reading its location from
    # the config file and only then loading the module from subdfolder
    sys.path.insert(0, os.path.join(config['tools_location'], 'lib/python'))
    # Until we get rid of our tools dep, this import(s) will break flake8 E402

    if action == 'submit-toplevel':
        submit_toplevel(task, config, balrog_auth)
    elif action == 'schedule':
        schedule(task, config, balrog_auth)
    else:
        submit_locale(task, config, balrog_auth)
コード例 #7
0
def test_get_task_server(config, defn):
    with pytest.raises(ValueError):
        get_task_server(defn, config)
コード例 #8
0
def test_get_task_server(config, defn):
    with pytest.raises(ValueError):
        get_task_server(defn, config)