-
Notifications
You must be signed in to change notification settings - Fork 81
/
runtests-functional
executable file
·56 lines (48 loc) · 1.41 KB
/
runtests-functional
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
#!/bin/bash
# If this is not a Travis build, just execute runtests.py
if [[ -z $TRAVIS ]]
then
./runtests.py --functional
# We are on a Travis build
else
# Perform any final installations and setups before running tests on Travis
npm install
npm run-script build
npm install bootstrap-sass --prefix cadasta/core
cd cadasta
./manage.py migrate
./manage.py loadstatic
./manage.py loadfunctestfixtures
./manage.py runserver 0.0.0.0:8000 &
until curl http://0:8000 -f; do sleep .1; done # Wait for the Django server to start up
cd ..
# Run the test suite in the Travis VM for PRs to master
if [[ $TRAVIS_EVENT_TYPE == pull_request ]]
then
export CADASTA_TEST_WEBDRIVER=Firefox
./runtests.py --functional -m "$TESTBATCH"
ret=$?
if [[ $ret != 0 ]]
then
curl -v http://0:8000/dashboard/
fi
fi
# Run the test suite via BrowserStack (as much as possible) for commits to master
if [[ $TRAVIS_EVENT_TYPE == push ]]
then
# BrowserStack cannot handle local file uploads
export CADASTA_TEST_WEBDRIVER=BrowserStack-Chrome
./runtests.py --functional -m "$TESTBATCH and not uploads"
ret=$?
if [[ $ret == 0 ]]
then
# Run file upload tests using the local WebDriver
export CADASTA_TEST_WEBDRIVER=Firefox
./runtests.py --functional -m "$TESTBATCH and uploads"
ret=$?
fi
fi
# Kill the Django server
killall python
exit $ret
fi