Skip to content

Commit

Permalink
script to test the reduce template
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed Nov 14, 2012
1 parent 8cc8b33 commit 03aa2ae
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/scripts/templates/reduce.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
set -e

tmpdir=`mktemp -d`

cd $tmpdir

echo "Running in $PWD"

mkdir 10.input
cd 10.input
for x in $(seq -w 1 10)
do
touch input.$x
done
cd ..
mkdir 20.reduce
cd 20.reduce
moa new reduce -t 'test reduce'
moa set input=../10.input/input.*
moa set output=./output
moa set process='echo {{ input|join(" ") }} > {{ output }}'
moa run
ls -l
cat ./output
grep '../10.input/input.07' ./output
grep '../10.input/input.02' ./output
grep '../10.input/input.12' ./output || false && true
cd ..

rm -rf $tmpdir

0 comments on commit 03aa2ae

Please sign in to comment.