code
stringlengths
1
1.96M
language
stringclasses
1 value
#!/bin/bash # A very minimal test script if [ "$1" == "start" ]; then #echo "Starting $*" echo "$COMMAND" >> dummy1.log.txt bash -c "if $COMMAND ; then echo 0 > $$.txt ; else echo 1 > $$.txt; fi" & PROCID=$! echo $PROCID echo $$ > $PROCID.id.txt elif [ "$1" == "status" ]; then SHELL_PROC_ID=`cat $2.id.tx...
Shell
#!/bin/bash # A very minimal test script if [ "$1" == "start" ]; then #echo "Starting $*" echo "$COMMAND" >> dummy3.log.txt bash -c "if $COMMAND ; then echo 0 > $$.txt ; else echo 1 > $$.txt; fi" & PROCID=$! echo $PROCID echo $$ > $PROCID.id.txt elif [ "$1" == "status" ]; then SHELL_PROC_ID=`cat $2.id.tx...
Shell
source ../testsupport.sh ./cleanup.sh run grep -q "Stage init" test.out || err "Failed to find expected stage init" grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage there" test.out || err "Failed to find expected stage there" grep -q "Stage world" test.out || err "Failed to ...
Shell
ls | grep '[0-9].*.txt' | xargs rm -f rm -f dummy*.log.txt
Shell
source ../testsupport.sh run s_*.txt grep -q "INPUTS: s_2_ignore_b_1.txt s_2_ignore_b_2.txt" test.out || err "Failed to find correct split group 2.b" grep -q "INPUTS: s_1_ignore_b_1.txt s_1_ignore_b_2.txt" test.out || err "Failed to find correct split group 1.b" grep -q "INPUTS: s_2_ignore_a_1.txt s_2_ignore_a_2.txt"...
Shell
source ../testsupport.sh run test.txt exists test.hello.csv exists test.hello.world.xml grep -q "Stage mars" test.out && err "Stage executed incorrectly" grep -qi "failed" test.out && err "Something failed but there should have been no failure" true
Shell
rm -rf *.xml *.csv
Shell
source ../testsupport.sh run test.txt exists out/test.csv notexists test.csv true
Shell
rm -f *.csv out/*.csv
Shell
source ../testsupport.sh run grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Mars" test.out || err "Failed to find expected output Mars" true
Shell
#!/bin/bash # Clean up standard unwanted files for i in .bpipe test.out commandlog.txt doc ; do find . -name "$i" | xargs rm -rf done # Run individual cleanup scripts for i in `find . -name cleanup.sh`; do cd `dirname $i`; chmod uga+rx ./cleanup.sh; ./cleanup.sh; cd - > /dev/null 2>&1 ; done
Shell
source ../testsupport.sh run grep -q "^mars" test.out || err "Failed to find mars printed out" grep -q "^world" test.out || err "Failed to find world printed out" grep -q "^jupiter" test.out || err "Failed to find mars printed out" true
Shell
source ../testsupport.sh rm -f test.txt.* rm -rf output bpipe run -d output test.groovy test.txt > test.out 2>&1 grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage world" test.out || err "Failed to find expected stage world" [ ! -f output/test.txt.hello ] && err "Failed to ...
Shell
source ../testsupport.sh . ./cleanup.sh run test.txt grep -q "Stage hello" test.out || err "Failed to find expected stage hello" [ ! -f test.hello.txt ] && err "Failed to find expected output test.hello.txt" [ ! -f .bpipe/outputs/hello.test.hello.txt.properties ] && err "Failed to find expected output meta data fi...
Shell
rm -f test.*.txt
Shell
source ../testsupport.sh run test1.txt test1.csv test2.txt exists test1.hello.xml [ `cat test1.hello.xml | groovy -e 'print(System.in.readLines()[0..1] == ["2","3"])'` == true ] || err "Contents of output file test1.hello.xml didn't match expected" true
Shell
rm -f *.xml
Shell
source ../testsupport.sh run grep -q "Stage child_stage" test.out || err "Failed to find expected stage child_stage" true
Shell
source ../testsupport.sh rm -rf doc run test.txt grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage bar" test.out || err "Failed to find expected stage world" grep -q "Stage fail" test.out || err "Failed to find expected stage world" [ -e doc/index.html ] || err "Unable to fi...
Shell
source ../testsupport.sh run test.txt [ ! -f test.chr1.csv ] && err "Failed to find expected output test.chr1.csv" [ ! -f test.chr20.csv ] && err "Failed to find expected output test.chr20.csv" [ ! -f test.chrX.csv ] && err "Failed to find expected output test.chrX.csv" [ ! -f test.chr1.txt ] && err "Failed to find...
Shell
rm -f test.*.csv test.*.txt *.hello.* test.txt.*;
Shell
source ../testsupport.sh run grep -q "foo = cat" test.out || err "Failed to find expected output foo = cat" grep -q "foo = tree" test.out || err "Failed to find expected output foo = tree" grep -q "foo = fubar" test.out || err "Failed to find expected output foo = fubar" true
Shell
source ../testsupport.sh run exists out1.txt out2.txt out3.txt
Shell
rm -f e g null out*.txt hello*
Shell
source ../testsupport.sh run test.groovy test.bam exists test.align.bam
Shell
rm -rf *.sai commandlog.txt .bpipe *.align.bam
Shell
source ../testsupport.sh run test.txt test.xml exists test.wow.xml
Shell
rm -f *.wow.* *.csv
Shell
source ../testsupport.sh rm -f test.world.txt test.txt run grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage world" test.out || err "Failed to find expected stage world" [ ! -f test.txt ] && err "Failed to find expected output test.txt" [ ! -f test.world.txt ] && err "Failed...
Shell
source ../testsupport.sh rm -f *align* *foo* run s_*.txt grep -q "Stage dedupe" test.out || err "Failed to find expected stage dedupe" grep -q "Stage align" test.out || err "Failed to find expected stage align" [ ! -f s_2_1.txt.foo.align ] && err "Failed to find expected output s_2_1.txt.foo.align" [ ! -f s_3_1.tx...
Shell
source ../testsupport.sh run input*.txt #grep -q "Stage hello" test.out || err "Failed to find expected stage hello" #grep -q "Stage world" test.out || err "Failed to find expected stage world" #grep -q "Stage world2" test.out || err "Failed to find expected stage world2" #grep -q "Stage end" test.out || err "Failed ...
Shell
rm -f *.hello *.hello.*
Shell
source ../testsupport.sh bpipe run -l db=1 test.groovy > test.out for i in foo bar tree; do grep -A 1 "Using resource $i" test.out | grep -q "End using resource $i" || err "Failed to find end using resource directly after start using resource with concurrency 1" done true
Shell
source ../testsupport.sh run *.bed *.peak exists s2_macs_sort.macs.intersect.bed s1_macs_sort.macs.intersect.bed true
Shell
rm -f *.intersect.*
Shell
source ../testsupport.sh . ./cleanup.sh run s_1_1.txt s_1_2.txt s_2_1.txt s_2_2.txt grep -q "Stage align" test.out || err "Failed to find expected stage align" exists s_1_1.chr1.bam true
Shell
rm -f *align* *.bam
Shell
source ../testsupport.sh run test_*.txt exists test_bar.hello.csv exists test_foo.hello.csv true
Shell
rm -f *.csv
Shell
source ../testsupport.sh bpipe run dir/test.groovy > test.out grep -q world test.out || err "Failed to find expected output 'world' in output" true
Shell
source ../testsupport.sh export BPIPE_LIB=./bpipelib rm -f test.*.txt run grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage world" test.out || err "Failed to find expected stage world" grep -q "Stage jupiter" test.out || err "Failed to find expected stage jupiter" grep -q "S...
Shell
rm -f test.*.txt
Shell
source ../testsupport.sh run test_*.txt test.csv grep -q "inputs.txt: cat test_1.txt test_2.txt > test_1.txt.hello" test.out || err "Failed to find expected output 'inputs.txt: cat test_1.txt test_2.txt > test_1.txt.hello'" grep -q "input.txt: cat test_1.txt > test_1.txt.hello" test.out || err "Failed to find expect...
Shell
rm -f test_1.txt.hello
Shell
source ../testsupport.sh rm -f test.world.txt test.txt run grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage world" test.out || err "Failed to find expected stage world" [ ! -f test.txt ] && err "Failed to find expected output test.txt" [ ! -f test.world.txt ] && err "Failed...
Shell
source ../testsupport.sh run test.txt test2.txt test.csv grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "inputs: test.txt test2.txt test.csv" test.out || err "Failed to find expected output: inputs: test.txt test2.txt test.csv" true
Shell
source ../testsupport.sh run test.txt grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage world" test.out || err "Failed to find expected stage world" [ ! -f mars.txt ] && err "Failed to find expected output mars.txt" [ ! -f world.txt ] && err "Failed to find expected output wo...
Shell
rm -f mars.txt world.txt foo.txt query.out
Shell
source ../testsupport.sh bpipe run -n 10 test.groovy > test.out exists hello hello2 hello3 hello4 # each one should have gotten 3 threads (10/3) [ `cat hello` == 3 ] || echo "Wrong number of threads assigned to thread variable in multi statement" [ `cat hello2` == 3 ] || echo "Wrong number of threads assigned to t...
Shell
rm -f hello*
Shell
source ../testsupport.sh run test.txt exists test.foo.csv test.foo.xml true
Shell
rm -f *.csv *.xml
Shell
source ../testsupport.sh run grep -q "x = 15 and y = 20" test.out || err "Did not find expected values x = 15 and y = 20 in output" grep -q "Variable or parameter 'x' was not specified" test.out || err "Did not find expected text 'Variable or parameter 'x' was not specified' in output" true
Shell
source ../testsupport.sh run grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "world" test.out || err "Failed to find expected output world" true
Shell
source ../testsupport.sh # Should fail! run test.txt # Should clean up this file notexists test.hello.csv true
Shell
rm -f *.csv
Shell
source ../testsupport.sh run test1.txt test2.txt exists test1.foo.txt test2.foo.txt true
Shell
rm -f *.foo.txt
Shell
source ../testsupport.sh source ./cleanup.sh run test.txt test2.txt grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage world" test.out || err "Failed to find expected stage world" [ ! -f test.hello.txt ] && err "Failed to find expected output test.hello.txt" [ ! -f test.hello...
Shell
rm -f test.hell*.txt
Shell
source ../testsupport.sh run test.txt grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage world" test.out || err "Failed to find expected stage world" grep -q "Stage world2" test.out || err "Failed to find expected stage world2" grep -q "Stage end" test.out || err "Failed to fin...
Shell
rm -f test.txt.*
Shell
source ../testsupport.sh run test.txt exists test.csv.mars exists test.csv.world exists test.xml
Shell
rm -rf *.csv *.world *.xml *.mars
Shell
#!/bin/bash source ../testsupport.sh BPIPE_LIB=./modules bpipe run test.groovy > test.out grep -q "Error evaluating script" test.out && err "Error while evaluating script" grep -q "hello world" test.out || err "Failed to find expected expression 'hello world' in output" true
Shell
source ../testsupport.sh run exists world_dir/hello.txt exists mars_dir/hello.txt exists hello true
Shell
rm -rf world *.txt hello world_dir mars_dir outputfolder
Shell
source ../testsupport.sh run test.txt exists test.txt.hello test.txt.hello.there test.txt.hello.world # The stage "there" shouldn't produce this output meta data because # meta data for the same output was already produced by the previous stage notexists .bpipe/outputs/there.test.txt.hello.properties true
Shell
rm -rf .bpipe test.txt.*;
Shell
. ../testsupport.sh . ./cleanup.sh run test.txt grep -q "Stage hello" test.out || err "Failed to find expected stage hello" [ `grep -c "execute" test.out ` == 4 ] || err "All stages did not execute on first run" # Running a second time should skip the stages run test.txt grep -q "execute" test.out && err "comm...
Shell
rm -f *.html *.xls *.csv *.xml rm -f query.test.out rm -rf .bpipe/outputs
Shell
source ../testsupport.sh run test.txt exists test.bar.hello.csv test.foo.hello.csv test.tree.hello.csv true
Shell
rm -f *.csv
Shell
source ../testsupport.sh run grep -q "World" test.out || err "Failed to find last stage (World) printed in output: something went wrong" true
Shell
source ../testsupport.sh . ./cleanup.sh ../../bin/bpipe run -p foo=foooo -p bar=baaaar test.groovy > test.out grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage world" test.out || err "Failed to find expected stage world" grep -q "Stage there" test.out || err "Failed to find e...
Shell
rm -f test.world.txt test.there.txt test.txt
Shell
source ../testsupport.sh run grep -q "Command failed" test.out && err "Failed to execute bash command terminated with ampersands" true
Shell
source ../testsupport.sh BPIPE_LIB_OLD="$BPIPE_LIB" export BPIPE_LIB=`pwd`/bpipes uname -a | grep -i -q cygwin && { export BPIPE_LIB=`cygpath -ma $BPIPE_LIB` } echo "Using BPIPE_LIB=$BPIPE_LIB" rm -f test.world.txt test.txt run grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -...
Shell
rm -f test.f*
Shell
source ../testsupport.sh . ./clean.sh run test.txt grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage world" test.out || err "Failed to find expected stage world" [ ! -f test.f1 ] && err "Failed to find expected output test.f1" [ ! -f test.f2 ] && err "Failed to find expected...
Shell
source ../testsupport.sh rm -f *align* run s_*.txt grep -q "Stage dedupe" test.out || err "Failed to find expected stage dedupe" grep -q "Stage align" test.out || err "Failed to find expected stage align" grep -q "Stage compute_statistics" test.out || err "Failed to find expected stage compute_statistics" [ ! -f s...
Shell
rm -f *align*
Shell
source ../testsupport.sh run test.txt test2.txt # the world stage should create an output file from the CSV files created in hello stage exists test.hello.world.txt # Check that it really used BOTH CSV files created by the earlier nested stage grep -q 'test.hello.csv test2.hello.csv' commandlog.txt || err "Failed to...
Shell
rm -f *.xml *.csv test.*.txt
Shell
source ../testsupport.sh . ./cleanup.sh run grep -q "Stage hello" test.out || err "Failed to find expected stage hello" cat test.out | grep -o "Stage hello_." | sort | uniq -c > counts.txt for c in a b c d e ; do grep -q "1 Stage hello_$c" counts.txt || err "Wrong counts for stage $c" done true
Shell
rm -f hello_*.txt rm -f counts.txt
Shell
source ../testsupport.sh run foo.txt bar.csv exists bar.hello.xml true
Shell
rm -f *.xml
Shell
source ../testsupport.sh . cleanup.sh export BPIPE_LIB=./lib run grep -q "Stage there" test.out || err "Failed to find expected stage there" grep -q "Stage world" test.out || err "Failed to find expected stage world" grep -q "Stage buddy" test.out || err "Failed to find expected stage buddy" grep -q "Stage foo" te...
Shell
rm -f test.world.txt test.there.txt test.buddy.txt
Shell
source ../testsupport.sh run s_1.txt grep -q "foo = cat" test.out || err "Failed to find expected output foo = cat" grep -q "foo = bar" test.out || err "Failed to find expected output foo = bar" true
Shell
source ../testsupport.sh run test.bam exists test.chr1.hello.bam exists test.chr2.hello.bam true
Shell
rm -f test.*chr*.bam
Shell
source ../testsupport.sh run test.txt exists test.txt.hello [ `cat test.txt.hello` == foo ] || err "Incorrect contents in output file test.txt.hello" true
Shell
rm -f hello
Shell
source ../testsupport.sh source ./cleanup.sh run test.txt grep -q "Stage hello" test.out || err "Failed to find expected stage hello" grep -q "Stage world" test.out || err "Failed to find expected stage world" grep -q "Stage end" test.out || err "Failed to find expected stage end" [ ! -f test.txt.hello ] && err "Fa...
Shell
rm -f test.txt.*
Shell
source ../testsupport.sh run test.txt grep -q 'test.hello.there.vep.csv' test.out && err "Output contains reference to incorrect file, test.hello.there.vep.csv" exists variants/test.hello.vep.vcf true
Shell
rm -rf *.vcf *.csv qc variants
Shell
source ../testsupport.sh run test.vcf test.bam exists test.ma.bam true
Shell