forked from superdesk/superdesk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
104 lines (92 loc) · 3.38 KB
/
.travis.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
language: python
sudo: false
env:
- TARGET=unit
- TARGET=server_ldap
- TARGET=e2e_chrome
# - TARGET=e2e_firefox
python:
- "3.4"
matrix:
allow_failures:
- env: TARGET=e2e_firefox
services:
- mongodb
- elasticsearch
- redis-server
cache:
directories:
- $HOME/.cache/pip
- $HOME/.npm
- $HOME/.cache/bower
before_install:
- if [ "${TARGET}" = "unit" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
npm install -g grunt-cli bower ;
fi
- if [ "${TARGET}" != "${TARGET/e2e/}" ]; then
pip install requests &&
export DISPLAY=:99.0 &&
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1920x1080x24 ;
./scripts/get-chrome-url | wget -N --no-verbose -i - && unzip chrome-linux.zip &&
export CHROME_BIN=`pwd`/chrome-linux/chrome &&
$CHROME_BIN --version ;
fi
install:
- if [ "${TARGET}" = "unit" ] || [ "${TARGET}" != "${TARGET/server/}" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
cd server &&
pip install -r requirements.txt &&
cd .. ;
fi
- if [ "${TARGET}" = "unit" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
cd client && npm install && cd .. ;
fi
- if [ "${TARGET}" = "unit" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
cd client && bower install && cd .. ;
fi
- if [ "${TARGET}" = "unit" ]; then
cd server && pip install coveralls==1.0a2 && cd .. ;
fi
before_script:
- if [ "${TARGET}" != "${TARGET/e2e/}" ]; then
cd server ;
(nohup env SUPERDESK_URL='http://127.0.0.1:5000/api' SUPERDESK_CLIENT_URL='http://127.0.0.1:9000' SUPERDESK_TESTING='True' honcho start & );
cd ../client ;
grunt build --server='http://127.0.0.1:5000/api' --ws='ws://127.0.0.1:5100' ;
cd dist ;
while [ ! -f index.html ]; do sleep .5; done ;
(nohup python3 -m http.server 9000 & );
cd ../.. ;
fi
script:
- if [ "${TARGET}" = "unit" ]; then
cd client && npm test && cd .. ;
cd server && flake8 && cd .. ;
cd server && behave ./features/ --format progress2 --logging-level ERROR && cd .. ;
cd server && nosetests --with-coverage --cover-package=superdesk,apps && cd .. ;
fi
- if [ "${TARGET}" = "server_ldap" ]; then
cd server &&
LDAP_SERVER="ldap://sourcefabric.org" LDAP_BASE_FILTER="OU=Superdesk Users,dc=sourcefabric,dc=org" behave ./features/ --format progress2 --logging-level ERROR &&
cd .. ;
fi
- if [ "${TARGET}" != "${TARGET/e2e/}" ]; then
cd server &&
python3 manage.py users:create -u admin -p admin -e '[email protected]' --admin=true 2>&1 ;
cd ../client &&
./node_modules/.bin/webdriver-manager update &&
./node_modules/.bin/protractor protractor-conf.js
--stackTrace --verbose
--baseUrl 'http://127.0.0.1:9000'
--params.baseBackendUrl 'http://127.0.0.1:5000/api'
--params.username 'admin'
--params.password 'admin'
--capabilities.browserName "${TARGET/e2e_/}"
;
fi
after_script:
- killall -9 python
after_success:
- if [ "${TARGET}" = "unit" ]; then
cd client && grunt coveralls && cd .. ;
cd server && coveralls --merge="../client/coveralls.json" ;
fi