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)
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)
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))
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)
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)
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)
def test_get_task_server(config, defn): with pytest.raises(ValueError): get_task_server(defn, config)