Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
Merge pull request #287 from irinamok/master
Browse files Browse the repository at this point in the history
Updated bash script for mocha tests to run on test machine
  • Loading branch information
eliseosoto committed Jul 24, 2012
2 parents b31be04 + 094059d commit 4835be7
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions server/test/mocha_tests.sh
Expand Up @@ -3,9 +3,16 @@
clear

echo "Make sure test Mongo db is not running"
MONGO_PID=`ps | grep 27018 | grep mongod | awk '{print $1}'`
MONGO_PID=`ps -ef |grep 27018|grep mongod |awk '{print $2}'`
if [[ "$MONGO_PID" != "" ]]; then
kill -9 $MONGO_PID
echo "killing mongod $MONGO_PID"
kill -15 $MONGO_PID
fi

#remove lock file if it exists
if [ -e /home/idefix/sandbox/data/test-db/mongod.lock ];then
echo "removing mongod lock file"
rm /home/idefix/sandbox/data/test-db/mongod.lock
fi

echo "Setting up variables"
Expand All @@ -27,12 +34,12 @@ npm install
cd ..

echo "Starting test db"
"$MONGO_START" --dbpath $TEST_DB --port 27018 &
$MONGO_START --dbpath $TEST_DB --port 27018 &

echo "Executing mocha tests"
cd server
mocha

echo "Killng test Mongo db process"
MONGO_PID=`ps | grep 27018 | grep mongod | awk '{print $1}'`
kill -9 $MONGO_PID
MONGO_PID=`ps -ef |grep 27018|grep mongod |awk '{print $2}'`
kill -15 $MONGO_PID

0 comments on commit 4835be7

Please sign in to comment.