Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated file again for the test machine

  • Loading branch information...
commit 094059d73d05fa19a9f7e792356763a11cb0b866 1 parent b31be04
Irina Mok authored
Showing with 12 additions and 5 deletions.
  1. +12 −5 server/test/mocha_tests.sh
View
17 server/test/mocha_tests.sh
@@ -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"
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.