Skip to content

Commit

Permalink
Tests to verify duration of test execution, a strong indicator of (de…
Browse files Browse the repository at this point in the history
…sired) parallelism.
  • Loading branch information
Samuel A. Falvo II committed Oct 11, 2012
1 parent d5ba8b2 commit 7db0872
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/run.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
CWD=`dirname $0` CWD=`dirname $0`
CWD=`cd "$APP_DIR";pwd` CWD=`cd "$APP_DIR";pwd`


START=$(date +%s)
"${CWD}/bin/whiskey" --independent-tests "${CWD}/example/test-long-running-1.js ${CWD}/example/test-long-running-2.js" "${CWD}/bin/whiskey" --independent-tests "${CWD}/example/test-long-running-1.js ${CWD}/example/test-long-running-2.js"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "long-running tests should pass" echo "long-running tests should pass"
exit 1 exit 1
fi fi
END=$(date +%s)
DIFF=$(( $END - $START ))
if [ $DIFF -ge 6 ]; then
echo "Total test execution time should be less than 6 seconds (assuming code hasn't been changed.)"
fi


"${CWD}/bin/whiskey" --independent-tests "${CWD}/example/test-long-running-1.js ${CWD}/example/test-long-running-2.js ${CWD}/example/test-failure.js" "${CWD}/bin/whiskey" --independent-tests "${CWD}/example/test-long-running-1.js ${CWD}/example/test-long-running-2.js ${CWD}/example/test-failure.js"
if [ $? -ne 2 ]; then if [ $? -ne 2 ]; then
Expand Down

0 comments on commit 7db0872

Please sign in to comment.