forked from 4minitz/4minitz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.sh
executable file
·64 lines (48 loc) · 1.5 KB
/
travis.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
62
63
64
TEST="$1"
PATH=$PATH:$HOME/.meteor/
if [ "$TRAVIS" = "true" ]; then
BUILD=$TRAVIS_BUILD_NUMBER
JOB=$TRAVIS_JOB_NUMBER
echo Find screenshots here: http://s3files.4minitz.com/4minitz/4minitz/$BUILD/$JOB/tests/snapshots
fi
if [ "$TEST" = "unit and i18n" ]; then
echo Run i18n test
npm run test:i18n
I18N=$?
echo Run unit test
npm run test:unit
UNIT=$?
exit $(($UNIT + $I18N))
fi
echo Run end2end tests: "$TEST"
echo Remove old log file
rm server.log
echo Start end2end server
npm run test:end2end:server > server.log&
COUNTER=0
MAX_WAIT=900
until grep "=> App running at" server.log; do
echo App has not started yet.. Waiting for $COUNTER seconds
sleep 30
COUNTER=$(($COUNTER+30))
if [ $COUNTER -gt $MAX_WAIT ]; then
echo Meteor takes too long to start, exiting. Server log:
cat server.log
exit 1
fi
done
sleep 10
echo Start end2end test runner
export CHROME_LOG_FILE=$(pwd)/client.log
chimp .meteor/chimp_config_headless.js --ddp=http://localhost:3100 --mocha --path=tests/end2end --browser=chrome -- $TEST tests/end2end/setup.js
CHIMP_RESULT=$?
echo Server log: http://4m.js42.de/4minitz/4minitz/$BUILD/$JOB/server.log
echo Client log: http://4m.js42.de/4minitz/4minitz/$BUILD/$JOB/client.log
mkdir tests/mongodump
mongodump -h localhost:3101 -d meteor -o ./tests/mongodump
# archive versions
mkdir versions
npm ls > ./versions/npm.txt
google-chrome --version > ./versions/chrome.txt
chimp --version > ./versions/chimp.txt
exit $CHIMP_RESULT