Beispiel #1
0
async def async_main(context):
    """Run all the vcs things.

    Args:
        context (TreeContext): the treescript context.

    """
    connector = aiohttp.TCPConnector()
    async with aiohttp.ClientSession(connector=connector) as session:
        context.session = session
        work_dir = context.config['work_dir']
        actions_to_perform = task_action_types(context.task, context.config)
        await log_mercurial_version(context)
        if not await validate_robustcheckout_works(context):
            raise ScriptWorkerException("Robustcheckout can't run on our version of hg, aborting")
        await checkout_repo(context, work_dir)
        if actions_to_perform:
            await do_actions(context, actions_to_perform, work_dir)
    log.info("Done!")
Beispiel #2
0
def test_task_action_types_missing_action(scopes):
    task = {"scopes": scopes}
    with pytest.raises(TaskVerificationError):
        utils.task_action_types(task, SCRIPT_CONFIG)
Beispiel #3
0
def test_task_action_types_valid_scopes(actions, scopes):
    task = {"scopes": scopes}
    assert actions == utils.task_action_types(task, SCRIPT_CONFIG)
Beispiel #4
0
def test_task_action_types_missing_action(scopes):
    task = {"scopes": scopes}
    with pytest.raises(TaskVerificationError):
        utils.task_action_types(task)
Beispiel #5
0
def test_task_action_types_valid_scopes(scopes):
    task = {"scopes": scopes}
    assert tuple(scopes) == utils.task_action_types(task)
Beispiel #6
0
def test_task_action_types_invalid_action(scopes):
    task = {"scopes": scopes}
    with pytest.raises(TaskVerificationError):
        utils.task_action_types(task, SCRIPT_CONFIG)
Beispiel #7
0
def test_task_action_types_valid_scopes(actions, scopes):
    task = {"scopes": scopes}
    assert actions == utils.task_action_types(task, SCRIPT_CONFIG)