forked from verifiedpixel/verifiedpixel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
129 lines (117 loc) · 4.97 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
language: python
sudo: false
env:
- TARGET=server_unit
- TARGET=client_unit
#- TARGET=server_ldap
#- TARGET=server_public_api
#- TARGET=e2e_chrome
# - TARGET=e2e_firefox
python:
- "3.4"
matrix:
allow_failures:
- env: TARGET=e2e_firefox
- env: TARGET=client_unit
fast_finish: true
services:
- mongodb
- elasticsearch
- redis-server
cache:
directories:
- $HOME/.cache/pip
- $HOME/.npm
- $HOME/.cache/bower
before_install:
- if [ "${TARGET}" = "client_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}" = "server_unit" ] || [ "${TARGET}" != "${TARGET/server/}" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
cd server &&
pip install -q -r requirements.txt &&
cd .. ;
fi
- if [ "${TARGET}" = "client_unit" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
cd client && npm install && cd .. ;
fi
- if [ "${TARGET}" = "client_unit" ] || [ "${TARGET}" != "${TARGET/e2e/}" ]; then
cd client && bower install && cd .. ;
fi
- if [ "${TARGET}" = "server_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:
#cd server && behave ./features/ --format progress2 --logging-level ERROR && cd .. ;
- if [ "${TARGET}" = "server_unit" ]; then
cd server && nosetests vpp --with-coverage --cover-package=vpp.verifiedpixel && cd .. &&
cd server && flake8 && cd .. ;
cp server/INSTALL.md server/INSTALL.md.orig &&
cp client/INSTALL.md client/INSTALL.md.orig &&
./generate-install-docs.sh ;
if [ $(diff server/INSTALL.md.orig server/INSTALL.md | wc -l) -ne 0 ]; then
echo "Server docs are not up-to-date" ;
exit 3 ;
fi ;
if [ $(diff client/INSTALL.md.orig client/INSTALL.md | wc -l) -ne 0 ]; then
echo "Client docs are not up-to-date" ;
exit 3 ;
fi ;
fi
- if [ "${TARGET}" = "client_unit" ]; then
cd client && npm test && 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}" = "server_public_api" ]; then
cd server &&
behave ./publicapi/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 'admin@example.com' --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:
#cd client && grunt coveralls && cd .. ;
- if [ "${TARGET}" = "server_unit" ]; then
cd server && coveralls --merge="../client/coveralls.json" ;
fi
notifications:
slack:
secure: VRr7XsiNpTropmFYTDqEvM+ZQ4Wwu00r/wlI8Vf9H9nuvyXwzjTyPrgcLbTlIs9WAaCcaFZmft2Wi0gu/GSi19MCzT3Wr2fhJrZOuaEbvOX6vYUojsRgPoIHHpxtiFUwEAL7HuO9EAGOmsz/KLAcleeCPl5e8lpBDhbzvsC3++Zhciann6UciEiCau1szIwS3ACwFKKOY7ZM1uWRbqBMBAKzMihJAZRN98bmuqXHpP55w+QNSLCRHQ9dlETuVT0OsQsa57OECLRqUoWHtXCzrQLgPT1hYluiiD0zsLf1A2ZyYcJonztaUB4RgVs2JEbirVCtJfE2A31AgLW4bMnN4ZkJx6sA/oHD/H9mkZfBo+aBd8KPU1+KWHL2idCIHyQTFiIA72krCb7QOyZbMmM/Jls3vQUQzjQolAbVfl4BnbekyZCb20K5r56Taf/VdqevhZOpMuZkKTwG25DgB3MPd7m2oX+NKqrg8R++12M8BBQGX3DABgVu/mB6Mu6muEGOjeC6D0EIYCRVsn57kzdT4XDyDV91ZyD2NVMpIt7KDUKrKYuj4r7muAbr5RqqZCqyctxZvkAHeME9AaucPGzRJ4Rd9EEDqMRNvNJ+czeDScaf7wo1mjT+Gh4/C4Qf/a0QxQCtOTCeIOfiEu1LjOW7ykqazs0DNMuzLJE2h2vpFl4=