Exemplo n.º 1
0
async def async_main(config, task):
    """Run all the vcs things.

    Args:
        config (dict): the running config.
        task (dict): the running task.

    """
    work_dir = config["work_dir"]
    repo_path = os.path.join(work_dir, "src")
    actions_to_perform = task_action_types(config, task)
    await log_mercurial_version(config)
    if not await validate_robustcheckout_works(config):
        raise TreeScriptError("Robustcheckout can't run on our version of hg, aborting")
    await retry_async(do_actions, args=(config, task, actions_to_perform, repo_path), retry_exceptions=(CheckoutError, PushError))
    log.info("Done!")
Exemplo n.º 2
0
def test_task_action_types_missing_action(scopes):
    task = {"scopes": scopes}
    with pytest.raises(TaskVerificationError):
        ttask.task_action_types(SCRIPT_CONFIG, task)
Exemplo n.º 3
0
def test_task_action_types_valid_scopes(actions, scopes):
    task = {"scopes": scopes}
    assert actions == ttask.task_action_types(SCRIPT_CONFIG, task)
Exemplo n.º 4
0
def test_task_action_types_actions(actions):
    task = {"payload": {"actions": actions}}
    assert actions == ttask.task_action_types(SCRIPT_CONFIG, task)
Exemplo n.º 5
0
def test_should_push_false(task):
    actions = ttask.task_action_types(SCRIPT_CONFIG, task)
    assert False is ttask.should_push(task, actions)
Exemplo n.º 6
0
def test_task_action_types_actions_invalid(actions):
    task = {"payload": {"actions": actions}}
    with pytest.raises(TaskVerificationError):
        ttask.task_action_types(SCRIPT_CONFIG, task)