code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/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 |
#!/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
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 test2.hello.xml
[ `cat test2.hello.xml | groovy -e 'print(System.in.readLines()[0..1] == ["2","3"])'` == true ] || err "Contents of output file test2.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
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
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"
[ ! -f s_1_1.chr1.bam ] && err "Failed to find expected output s_1_1.align.txt"
true
| Shell |
rm -f *align* *.bam
| 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
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.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 -q Skipping test.out && err "Found unexpected phrase Skipping steps"
# Running a second time should skip the stages
run test.txt
grep -q "Skipping steps" test.out || err "Failed to f... | Shell |
rm -f *.html *.xls *.csv *.xml
rm -f query.test.out
rm -rf .bpipe/outputs
| 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 |
rm -f *align*
| 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 |
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.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.vcf test.bam
exists test.ma.bam
true
| Shell |
rm -f *.ma.*
| Shell |
source ../testsupport.sh
run test.txt
grep -q "Stage world" test.out || err "Failed to execute stage world"
exists test.txt.hello test1.world.xml test*.world.tsv
true
| Shell |
rm -rf test.txt.hello test1.csv test1.world.*
| Shell |
source ../testsupport.sh
run test.txt
exists test.hello.csv
exists test.hello.world.csv
true
| Shell |
rm -f *.csv *.hello
| Shell |
source ../testsupport.sh
run test.txt
exists test.txt.hello test.txt.csv
| Shell |
rm -f *.csv test.txt.*
| 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
rm -f *align*
run
grep -q "An input pattern was specified '.*' but no inputs were given when Bpipe was run" test.out || err "Failed to find expected error message"
true
| Shell |
source ../testsupport.sh
. ./cleanup.sh
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" test.out && err "Observe... | Shell |
rm -f test.world.txt test.there.txt test.buddy.txt
| Shell |
#!/bin/bash
TESTS=`find . -maxdepth 1 -type d | grep "[A-Za-z]"`
source testsupport.sh
succ=0
fail=0
failures=""
for t in $TESTS;
do
echo "============== $t ================"
cd "$BASE"/"$t"
rm -rf .bpipe
if ./run.sh;
then
echo
echo "SUCCEEDED"
echo
let 'succ=succ+1'
else
echo
echo "FAILED"
ec... | Shell |
source ../testsupport.sh
rm -f test.txt.* test.hello.* test.bar
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"
run test.txt
grep -q "Skipping command" test.out || err "Failed to find stage being sk... | Shell |
rm -rf *.out *.csv *.xml test.*.txt doc
| Shell |
# Add BPipe from the project root to the path
if [ -z "$BASE" ];
then
BASE=`pwd`
if [ ! -e $BASE/../bin/bpipe ] && [ -e $BASE/../../bin/bpipe ] ;
then
BASE=`pwd`/..
fi
fi
PATH="$BASE/../bin:$PATH"
#which bpipe
if [ $? -ne 0 ]; then
echo Cannot find the 'bpipe' launch script on the path. Please make sure that... | Shell |
source ../testsupport.sh
run
exists foo.txt bar.txt
grep -q "Stage async_stuff" test.out || err "Failed to find expected stage async_stuff in output"
grep -q "Command.*failed" test.out || err "Failed to find expected failed command in output"
grep -q "Exit status = 1" test.out || err "Failed to find expected exit s... | Shell |
rm -f foo.txt bar.txt
| Shell |
source ../testsupport.sh
source ./cleanup.sh
run *.chr*.*vcf *.chr*bam
grep -c chr14 test.out | grep -q 1 || err "Unexpected number of references to chr14 - should be only 1"
grep -c chr15 test.out | grep -q 1 || err "Unexpected number of references to chr15 - should be only 1"
true
| Shell |
rm -f hello.txt
| Shell |
source ../testsupport.sh
. cleanup.sh
run test.txt
grep -q "Stage folder" test.out || err "Failed to find expected stage hello"
grep -q "Stage after" test.out || err "Failed to find expected stage world"
grep -q "Skipping" test.out && err "Skipped steps incorrectly on first run"
[ ! -f thefolder/output.csv ] && er... | Shell |
rm -rf thefolder *.after.xml .bpipe/outputs
| Shell |
source ../testsupport.sh
rm -f test.*vcf
run test.txt
grep -q "Stage hello" test.out || err "Failed to find expected stage hello"
grep -q "Stage filter_with_ext" test.out || err "Failed to find expected stage filter_with_ext"
[ ! -f test.vcf ] && err "Failed to find expected output test.vcf"
[ ! -f test.fix.vcf ] &... | Shell |
source ../testsupport.sh
rm -f test.xml test.csv
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.csv ] && err "Failed to find expected output test.csv"
[ ! -f test.xml ] && err "Failed to... | Shell |
source ../testsupport.sh
rm -f *.csv *.xml
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 "Inputs are test.csv test[0-9].xml test[0-9].xml test[0-9].xml" test.out || err "Failed to find expec... | Shell |
source ../testsupport.sh
run test1.fastq test2.fastq ref.fa
exists test1.paired.bam
grep -q "cat test1.fastq test2.fastq ref.fa" commandlog.txt || err "Failed to find correct command in commandlog.txt"
true
| Shell |
rm -f *.bam
| Shell |
source ../testsupport.sh
rm -f test.txt.hello test.csv.world *.hello *.world
run test.txt test.csv
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.hello ] && err "Failed to find expected output te... | Shell |
source ../testsupport.sh
rm -f test.foo.txt test.foo.bar.txt
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.foo.txt ] && err "Failed to find expected output test.foo.txt"
[ ! -f test.foo... | Shell |
source ../testsupport.sh
run
exists test2.csv
| Shell |
rm -rf *.csv .bpipe
| Shell |
source ../testsupport.sh
run *.chr14.*vcf *.chr14.*bam
grep -q "MUW09_C0R8HACXX_ATCACG_L001_R1.fastq.merge.dedupe.merge.reorder.rg.recal.chr14.realign.bam => MUW09_C0R8HACXX_ATCACG_L001_R1.fastq.merge.dedupe.merge.reorder.rg.recal.chr14.realign.test.bam" test.out || err "Expected MUW09_C0R8HACXX_ATCACG_L001_R1.fast... | Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.