def test_append_dep_resolver(): cmd = "python -m MICGENT.cwl_runner add-dep-resolver --pkg-name ngs-mstb --conda-env ariba --mode w my_dep_resolver.yaml" check_call(shlex.split(cmd)) cmd = "python -m MICGENT.cwl_runner add-dep-resolver --pkg-name ngs-mstb-py2 --conda-env ariba my_dep_resolver.yaml" check_call(shlex.split(cmd)) assert os.path.isfile("my_dep_resolver.yaml") assert os.path.isfile("deps/ngs-mstb-py2/1.0/env.sh") assert helpers.grep(r"ariba", "deps/ngs-mstb-py2/1.0/env.sh") ## previous env is still there? assert os.path.isfile("deps/ngs-mstb/1.0/env.sh") assert helpers.grep(r"ariba", "deps/ngs-mstb/1.0/env.sh")
def resumable(options): "Check to see if ddrescue log files exist and they indicate a resumable state." imgfile = helpers.image(options) ddrlog = imgfile + ddrescue.ddrlog_suffix btracelog = imgfile + btrace.BtraceParser.ddrlog_suffix usedlog = imgfile + getused.MapExtents.ddrlog_suffix if os.path.isfile(ddrlog) and os.stat(ddrlog).st_size > 0: if (os.path.isfile(usedlog) and helpers.grep(usedlog, 'ddrescue_used') and helpers.grep(usedlog, getused.MapExtents.logmagic)): return 'data' elif (os.path.isfile(btracelog) and helpers.grep(btracelog, 'ddrescue_used') and helpers.grep(btracelog, btrace.BtraceParser.logmagic)): return 'meta' else: raise Exception( 'Non-resumable state. Use {} in ddrescue directly or remove it.' .format(ddrlog)) else: return None
def resumable(options): "Check to see if ddrescue log files exist and they indicate a resumable state." imgfile = helpers.image(options) ddrlog = imgfile + ddrescue.ddrlog_suffix btracelog = imgfile + btrace.BtraceParser.ddrlog_suffix usedlog = imgfile + getused.MapExtents.ddrlog_suffix if os.path.isfile(ddrlog) and os.stat(ddrlog).st_size > 0: if (os.path.isfile(usedlog) and helpers.grep(usedlog, 'ddrescue_used') and helpers.grep(usedlog, getused.MapExtents.logmagic)): return 'data' elif (os.path.isfile(btracelog) and helpers.grep(btracelog, 'ddrescue_used') and helpers.grep(btracelog, btrace.BtraceParser.logmagic)): return 'meta' else: raise Exception('Non-resumable state. Use {} in ddrescue directly or remove it.' .format(ddrlog)) else: return None
def check_multiqc_cwl_tool_output(mqc_html): assert not helpers.grep(r"No sample data available to build a report",mqc_html), "Multiqc failed"
def test_run_toil(): check_call("cp {}/* ./".format(test_data_cwl_toil), shell=True) cmd = "python -m MICGENT.cwl_runner run-toil --logLevel DEBUG --runner-use-conda --runner-conda-env toil sorttool.cwl revsort-job.json" check_call(shlex.split(cmd)) assert os.path.isfile("out/output.txt") assert helpers.grep(r"whenever it is a damp", "out/output.txt")
def test_init_dep_resolver(): cmd = "python -m MICGENT.cwl_runner add-dep-resolver --pkg-name ngs-mstb --conda-env ariba --mode w my_dep_resolver.yaml" check_call(shlex.split(cmd)) assert os.path.isfile("my_dep_resolver.yaml") assert os.path.isfile("deps/ngs-mstb/1.0/env.sh") assert helpers.grep(r"ariba", "deps/ngs-mstb/1.0/env.sh")