示例#1
0
def main(filename):

    settings = config.read_config(namespace="_REACTOR")
    jobstore = PipelineJobStore(settings.mongodb)
    jobdef = json.load(open(filename, 'r'))
    resp = jobstore.create(jobdef)
    if resp is not None:
        print('Loaded job {}'.format(resp['uuid']))
示例#2
0
def test_job_list_job_dir(mongodb_settings, agave):
    # The listed path is set up for test_agavehelpers and the job_uuid is the
    # from data/tests/pipelinejob/tacbobot.json
    job_uuid = '107b93f3-1eae-5e79-8a18-0a480f8aa3a5'
    base = PipelineJobStore(
        mongodb_settings, agave=agave)
    dirlist = base.list_job_archive_path(job_uuid, recurse=True)
    assert '/sample/tacc-cloud/agavehelpers/upload/transcriptic/hello.txt' in dirlist
示例#3
0
def test_job_fsm_state_png(mongodb_settings, env_localonly):
    try:
        import pygraphviz
        base = PipelineJobStore(mongodb_settings)
        for data_struct in pipelinejob.get_jobs():
                graf = base.fsm_state_png(data_struct['uuid'])
                # This is the signature of PNG - \x89PNG
                assert 'iVBOR' in graf.decode('utf-8')
    except ModuleNotFoundError:
        pass
示例#4
0
def test_job_agaveclient(mongodb_settings, agave):
    base = PipelineJobStore(
        mongodb_settings, agave=agave)
    assert getattr(base, '_helper') is not None
示例#5
0
def test_job_handle_event_wrong_uuid(mongodb_settings, env_localonly):
    base = PipelineJobStore(mongodb_settings)
    for data_struct in pipelinejob.get_events_wrong_uuid():
        with pytest.raises(exceptions.UnknownJob):
            base.handle(data_struct['data'])
示例#6
0
def test_job_create(mongodb_settings, env_localonly):
    base = PipelineJobStore(mongodb_settings)
    for data_struct in pipelinejob.get_jobs():
        resp = base.create(data_struct['data'])
        assert resp['uuid'] == data_struct['uuid']
示例#7
0
def test_job_handle_event_ok(mongodb_settings, env_localonly):
    base = PipelineJobStore(mongodb_settings)
    for data_struct in pipelinejob.get_events():
        resp = base.handle(data_struct['data'])
        assert resp['uuid'] == data_struct['uuid']
示例#8
0
def test_job_name(mongodb_settings):
    base = PipelineJobStore(mongodb_settings)
    assert base.name == 'jobs'
示例#9
0
def test_job_uuid_tytpe(mongodb_settings):
    base = PipelineJobStore(mongodb_settings)
    assert base.get_uuid_type() == 'pipelinejob'
示例#10
0
def test_job_schema(mongodb_settings):
    base = PipelineJobStore(mongodb_settings)
    assert isinstance(base.schema, dict)
示例#11
0
def test_job_db_list_collection_names(mongodb_settings):
    base = PipelineJobStore(mongodb_settings)
    assert base.db.list_collection_names() is not None
示例#12
0
def test_job_db_heritable_schema(mongodb_settings):
    base = PipelineJobStore(mongodb_settings)
    assert 'archive_path' in base.get_indexes()
    # exclude via NEVER_INDEX_FIELDS
    assert 'data' not in base.get_indexes()
示例#13
0
def test_job_delete(mongodb_settings):
    base = PipelineJobStore(mongodb_settings)
    for data_struct in pipelinejob.get_jobs():
        resp = base.delete_document(data_struct['uuid'], force=True)
        assert resp.raw_result == {'n': 1, 'ok': 1.0}
示例#14
0
def test_job_db_init(mongodb_settings):
    base = PipelineJobStore(mongodb_settings)
    assert base is not None