Exemplo n.º 1
0
def test_orc_plain_failure(tmpdir, job_spec, shell):
    job_spec["_resolved_command_str"] = "iwillfail"
    job_spec["inputs"] = []
    local_dir = str(tmpdir)
    with chpwd(local_dir):
        orc = orcs.PlainOrchestrator(shell, submission_type="local",
                                     job_spec=job_spec)
        orc.prepare_remote()
        orc.submit()
        orc.follow()
    for fname in "status", "stderr", "stdout":
        assert op.exists(op.join(orc.meta_directory, fname + ".0"))
Exemplo n.º 2
0
    def fn(resource, jspec):
        create_tree(local_dir, {"d": {"in": "content\n"}})
        with chpwd(local_dir):
            orc = orcs.PlainOrchestrator(resource, submission_type="local",
                                         job_spec=jspec)
            orc.prepare_remote()
            assert orc.session.exists(
                op.join(orc.working_directory, "d", "in"))

            orc.submit()
            orc.follow()
            assert orc.session.exists(op.join(orc.working_directory, "out"))

            orc.fetch()
            assert open("out").read() == "content\nmore\n"
Exemplo n.º 3
0
    def fn(resource, jspec):
        create_tree(local_dir, {"d": {"in": "content\n"}})
        with chpwd(local_dir):
            orc = orcs.PlainOrchestrator(resource,
                                         submission_type="local",
                                         job_spec=jspec)
            orc.prepare_remote()
            assert orc.session.exists(op.join(orc.working_directory, "d",
                                              "in"))

            orc.submit()
            orc.follow()
            assert orc.session.exists(op.join(orc.working_directory, "out"))

            orc.fetch()
            assert open("out").read() == "content\nmore\n"

            metadir_local = op.relpath(orc.meta_directory,
                                       orc.working_directory)
            for fname in "status", "stderr", "stdout":
                assert op.exists(op.join(metadir_local, fname + ".0"))
Exemplo n.º 4
0
def test_orc_root_directory_error(shell, value):
    orc = orcs.PlainOrchestrator(shell, submission_type="local")
    with patch.object(orc.session, "query_envvars", return_value=value):
        with pytest.raises(OrchestratorError):
            orc.root_directory
Exemplo n.º 5
0
def test_orc_root_directory(shell):
    orc = orcs.PlainOrchestrator(shell, submission_type="local")
    assert orc.root_directory == op.expanduser("~/.reproman/run-root")
Exemplo n.º 6
0
def test_orc_resurrection_invalid_job_spec(check_orc_plain, shell):
    with pytest.raises(OrchestratorError):
        orcs.PlainOrchestrator(shell,
                               submission_type="local",
                               job_spec={},
                               resurrection=True)