def test_fourfront_starter2(start_run_nestedarray_data):
    starter = FourfrontStarter(**start_run_nestedarray_data)
    assert starter
    starter.run()
    assert len(starter.inp.args.input_files['input_file']['object_key']) == 2
    assert len(
        starter.inp.args.input_files['input_file']['object_key'][0]) == 2
Example #2
0
def test_merge_source_experiment(start_run_md5_mount_data):
    starter = FourfrontStarter(**start_run_md5_mount_data)
    starter.create_ff()
    starter.inp.add_args(starter.ff)
    assert 'input_file' in starter.inp.args.input_files
    assert 'mount' in starter.inp.args.input_files['input_file']
    assert starter.inp.args.input_files['input_file']['mount']
Example #3
0
def test_processed_extra_file_use_for(start_run_repliseq_data):
    starter = FourfrontStarter(**start_run_repliseq_data)
    exf = starter.pf_extra_files(['bg_px2', 'bw'], {
        'file_format': 'bw',
        'use_for': 'visualization'
    })
    assert len(exf) == 2
    assert exf[1]['file_format'] == 'bw' and 'use_for' in exf[1]
    assert exf[1]['use_for'] == 'visualization'
def test_fourfront_starter(start_run_md5_data):
    starter = FourfrontStarter(**start_run_md5_data)
    assert starter
    assert 'arguments' in starter.inp.wf_meta
    assert len(starter.inp.wf_meta['arguments']) == 2
    assert starter.inp.wf_meta['arguments'][1][
        'argument_type'] == 'Output report file'
    starter.run()
    assert len(starter.output_argnames) == 1
def test_fourfront_starter7(start_run_hicprocessingbam_customfield_wALL_data):
    """testing a case where input_bam is a list with two elements
    and without an extra file. It should not add any null secondary files."""
    starter = FourfrontStarter(
        **start_run_hicprocessingbam_customfield_wALL_data)
    assert starter
    starter.run()
    outjson = starter.inp.as_dict()
    assert 'secondary_files' in outjson['args']
    assert len(outjson['args']['secondary_files']) == 0
def test_fourfront_starter7c(start_run_hicprocessingbam_customfield_wALL_data):
    """testing a case where input_bam is a list with three elements,
    two without an extra file and one with an extra file.
    It should not add one element to the secondary files."""
    data = start_run_hicprocessingbam_customfield_wALL_data
    data['input_files'][0]['uuid'].append(
        '8a64c5e9-b669-425c-a78a-3177abc9ebd5')
    starter = FourfrontStarter(
        **start_run_hicprocessingbam_customfield_wALL_data)
    assert starter
    starter.run()
    outjson = starter.inp.as_dict()
    assert 'secondary_files' in outjson['args']
    assert len(outjson['args']['secondary_files']) == 1
Example #7
0
def test_merge_source_experiment(start_run_md5_data):
    input_file = {
        "bucket_name":
        "elasticbeanstalk-fourfront-webdev-wfoutput",
        "workflow_argument_name":
        "input_pairs",
        "uuid": [
            "d2c897ec-bdb2-47ce-b1b1-845daccaa571",
            "d2c897ec-bdb2-47ce-b1b1-845daccaa571"
        ],
        "object_key": ["4DNFI25JXLLI.pairs.gz", "4DNFI25JXLLI.pairs.gz"]
    }
    data = start_run_md5_data
    starter = FourfrontStarter(**data)
    starter.inp.input_files = [input_file]
    res = starter.merge_source_experiments()
    logger.debug("response from merge_source_experiment=" + str(res))
    assert 'fake_source_experiment' in res
Example #8
0
def test_add_meta_to_dynamodb(start_run_md5_data):
    jobid = 'randomtestjobid-' + str(uuid.uuid4())
    Job.add_to_dd(jobid, 'someexecname', 'somesfn', 'somelogbucket')
    starter = FourfrontStarter(**start_run_md5_data)
    starter.inp.jobid = jobid
    starter.create_ff()
    starter.add_meta_to_dynamodb()
    logger.debug("jobid=%s" % jobid)
    time.sleep(10)
    dd_info = Job.info(jobid)
    assert dd_info
    print(dd_info)
    assert 'WorkflowRun uuid' in dd_info
    assert dd_info['WorkflowRun uuid'] == starter.ff.uuid
    assert 'env' in dd_info
    assert dd_info['env'] == starter.tbn.env
    # cleanup
    dd = boto3.client('dynamodb')
    dd.delete_item(TableName=DYNAMODB_TABLE,
                   Key={DYNAMODB_KEYNAME: {
                       'S': jobid
                   }})
def test_fourfront_starter6(start_run_fixedname_data):
    starter = FourfrontStarter(**start_run_fixedname_data)
    assert starter
    starter.run()
    assert starter.inp.as_dict().get('_tibanna').get('run_name') == 'md5_test'
def test_fourfront_starter5(start_run_fail_data):
    starter = FourfrontStarter(**start_run_fail_data)
    assert starter
    starter.run()
def test_fourfront_starter4(start_run_dependency_fail_data):
    starter = FourfrontStarter(**start_run_dependency_fail_data)
    assert starter
    starter.run()
    assert starter.inp.dependency
def test_fourfront_starter8(
        start_run_hicprocessingbam_customfield_wArgname_data):
    starter = FourfrontStarter(
        **start_run_hicprocessingbam_customfield_wArgname_data)
    assert starter
    starter.run()