-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.travis-run-tests.sh
61 lines (51 loc) · 1.55 KB
/
.travis-run-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
set +e # failure OK for now...
set -x
# Run the unit tests, which run via Jasmine+Velocity.
ln -s /etc/sandcats-meteor-settings.json sandcats/dev-settings.json
make action-run-unit-tests
# Now run the full-on integration tests, which do DNS queries and do
# real timeouts so run somewhat slowly at the moment, requiring a
# working nginx setup etc.
pushd /vagrant/sandcats
MAIL_URL=smtp://localhost:2500/ MONGO_URL=mongodb://localhost/sandcats_mongo meteor run --settings /etc/sandcats-meteor-settings.json &
popd
# Wait for Meteor to come online, up to N seconds.
for i in $(seq 90)
do
nc -z localhost 3000
retval=$?
if [[ $retval == "0" ]]; then
echo -n '+'
echo " - Meteor has bound the port OK"
break
else
sleep 1
echo -n '.'
fi
done
# Wait for nginx to stop 502-ing, up to N seconds
sudo service nginx stop
sudo service nginx start
for i in $(seq 90)
do
curl -k -m 1 --silent --fail https://localhost:443/ -o /dev/null
retval=$?
if [[ $retval == "0" ]]; then
echo -n '+'
echo " - nginx responds with OK"
break
else
sleep 1
echo -n '.'
fi
done
# Make sure anything we prented before is newline-terminated.
echo
set -e # Failure is no longer OK!
set -x # Be verbose again.
# Adjust pdns configuration so the cache TTL is shorter. This way, the
# tests run faster.
printf '### testing optimizations\ncache-ttl=1\nnegquery-cache-ttl=1\nquery-cache-ttl=1\n### end testing optimizations' | sudo dd of=/etc/powerdns/pdns.conf conv=notrunc oflag=append
sudo service pdns restart
make action-run-tests