Exemplo n.º 1
0
def sm(runner, git_repo, resp_q, test_settings, meta, mock_server, mocked_run,
       req_q):
    test_settings.root_dir = os.getcwd()
    sm = SendManager(test_settings, process_q, notify_q, resp_q)
    meta._interface.send_run(mocked_run)
    sm.send(req_q.get())
    yield sm
Exemplo n.º 2
0
def sm(
    runner, process_q, notify_q, resp_q, test_settings, sender, mock_server, mocked_run,
):
    with runner.isolated_filesystem():
        test_settings.root_dir = os.getcwd()
        sm = SendManager(test_settings, process_q, notify_q, resp_q)
        sender.send_run(mocked_run)
        notify_q.get()
        sm.send(process_q.get())
        yield sm
Exemplo n.º 3
0
def sm(
    runner, sender_q, result_q, test_settings, mock_server, interface,
):
    with runner.isolated_filesystem():
        test_settings.root_dir = os.getcwd()
        sm = SendManager(settings=test_settings, record_q=sender_q, result_q=result_q, interface=interface,)
        yield sm
Exemplo n.º 4
0
def sm(
    runner,
    git_repo,
    record_q,
    result_q,
    test_settings,
    meta,
    mock_server,
    mocked_run,
    interface,
):
    sm = SendManager(
        settings=test_settings,
        record_q=record_q,
        result_q=result_q,
        interface=interface,
    )
    meta._interface.publish_run(mocked_run)
    sm.send(record_q.get())
    yield sm
Exemplo n.º 5
0
def test_resume_success(
    mocked_run,
    test_settings,
    mock_server,
    sender,
    process_q,
    notify_q,
    resp_q,
    start_rcv_thread,
):
    test_settings.resume = "allow"
    mock_server.ctx["resume"] = True
    sm = SendManager(test_settings, process_q, notify_q, resp_q)
    start_rcv_thread(sm)

    run_result = sender.send_run_sync(mocked_run)
    assert run_result.HasField("error") is False
    assert run_result.run.starting_step == 16
Exemplo n.º 6
0
def test_resume_error_never(
    mocked_run,
    test_settings,
    mock_server,
    sender,
    process_q,
    notify_q,
    resp_q,
    start_rcv_thread,
):
    test_settings.resume = "never"
    mock_server.ctx["resume"] = True
    sm = SendManager(test_settings, process_q, notify_q, resp_q)
    start_rcv_thread(sm)

    run_result = sender.send_run_sync(mocked_run)
    assert run_result.HasField("error")
    assert (
        run_result.error.message == "resume='never' but run (%s) exists" % mocked_run.id
    )