Skip to content

Commit c537b9d

Browse files
committed
Add (crappy) tests for running meteor and mongo.
1 parent 86ed80d commit c537b9d

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

tests/cli/test.sh

+49
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,55 @@ $METEOR bundle foo.tar.gz
6565
test -f foo.tar.gz
6666

6767

68+
echo "... run"
69+
70+
# kill any old test meteor
71+
# there is probably a better way to do this, but it is at least portable across macos and linux
72+
ps ax | grep -e 'meteor.js -p 9100' | grep -v grep | awk '{print $1}' | xargs kill
73+
74+
! $METEOR mongo > /dev/null 2>&1
75+
$METEOR reset > /dev/null 2>&1
76+
77+
test ! -d .meteor/local
78+
! ps ax | grep -e '--bind_ip 127.0.0.1 --port 9102' | grep -v grep > /dev/null
79+
80+
PORT=9100
81+
$METEOR -p $PORT > /dev/null 2>&1 &
82+
METEOR_PID=$!
83+
84+
sleep 1 # XXX XXX lame
85+
86+
test -d .meteor/local/db
87+
ps ax | grep -e '--bind_ip 127.0.0.1 --port 9102' | grep -v grep > /dev/null
88+
curl -s "http://localhost:$PORT" > /dev/null
89+
90+
echo "show collections" | $METEOR mongo
91+
92+
# kill meteor, see mongo is still running
93+
kill $METEOR_PID
94+
95+
sleep 4 # XXX XXX lame. have to wait for inner app to die via keepalive!
96+
97+
! ps ax | grep "$METEOR_PID" | grep -v grep > /dev/null
98+
ps ax | grep -e '--bind_ip 127.0.0.1 --port 9102' | grep -v grep > /dev/null
99+
100+
101+
echo "... rerun"
102+
103+
$METEOR -p $PORT > /dev/null 2>&1 &
104+
METEOR_PID=$!
105+
106+
sleep 1 # XXX XXX lame
107+
108+
ps ax | grep -e '--bind_ip 127.0.0.1 --port 9102' | grep -v grep > /dev/null
109+
curl -s "http://localhost:$PORT" > /dev/null
110+
111+
kill $METEOR_PID
112+
ps ax | grep -e '--bind_ip 127.0.0.1 --port 9102' | grep -v grep | awk '{print $1}' | xargs kill
113+
114+
115+
116+
68117
# XXX more tests here!
69118

70119

0 commit comments

Comments
 (0)