forked from GeoNode/geonode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
380 lines (351 loc) · 13.5 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
language: python
python:
- 3.8
git:
depth: 3
cache:
bundler: true
yarn: true
pip: true
directories:
- node_modules
- $HOME/buildout-cache
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
dist: focal
services:
- docker
addons:
hosts:
- geonode
chrome: stable
firefox: "latest-esr"
postgresql: "12"
apt:
packages:
- postgresql-12
- postgresql-client-12
- postgresql-server-dev-12
- postgresql-12-postgis-3
- nginx
branches:
only:
- master
- 3.x
jobs:
include:
- stage: unit-tests
name: "GeoServer-backend Core Modules Smoke Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.geoserver'
- DOCKER_COMPOSE_VERSION: 1.19.0
- GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
- GEOSERVER_SERVER_PORT: 8080
- ON_TRAVIS: 'True'
- TEST_RUN_CORE: 'True'
- MONITORING_ENABLED: 'False'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- GEOFENCE_SECURITY_ENABLED: 'False'
- stage: unit-tests
name: "GeoServer-backend Contrib Apps Smoke Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.geoserver'
- DOCKER_COMPOSE_VERSION: 1.19.0
- GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
- GEOSERVER_SERVER_PORT: 8080
- ON_TRAVIS: 'True'
- TEST_RUN_INTERNAL_APPS: 'True'
- MONITORING_ENABLED: 'False'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- stage: unit-tests
name: "GeoServer-backend CSW-Catalogue Smoke Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.geoserver'
- DOCKER_COMPOSE_VERSION: 1.19.0
- GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
- GEOSERVER_SERVER_PORT: 8080
- ON_TRAVIS: 'True'
- TEST_RUNNER_KEEPDB: 'True'
- TEST_RUN_INTEGRATION: 'True'
- TEST_RUN_INTEGRATION_SERVER: 'True'
- TEST_RUN_INTEGRATION_UPLOAD: 'False'
- TEST_RUN_INTEGRATION_MONITORING: 'False'
- TEST_RUN_INTEGRATION_CSW: 'True'
- TEST_RUN_INTEGRATION_BDD: 'False'
- MONITORING_ENABLED: 'False'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- CELERY_ALWAYS_EAGER: 'True'
- DATABASE_URL: 'postgis://geonode:geonode@localhost:5432/upload_test'
- GEODATABASE_URL: 'postgis://geonode:geonode@localhost:5432/upload_test'
- DEFAULT_BACKEND_DATASTORE: 'datastore'
- stage: unit-tests
name: "QGis Server-backend Core Modules Smoke Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.qgis_server'
- DJANGO_SETTINGS_MODULE: 'geonode.local_settings'
- DOCKER_COMPOSE_VERSION: 1.19.0
- QGIS_SERVER_URL: http://localhost:9000/
- SITEURL: http://localhost:8000/
- QGIS_SERVER_PORT: 9000
- ON_TRAVIS: 'True'
- TEST_RUN_CORE: 'True'
- MONITORING_ENABLED: 'False'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- CELERY_ALWAYS_EAGER: 'True'
- stage: unit-tests
name: "QGis Server-backend Contrib Apps Smoke Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.qgis_server'
- DJANGO_SETTINGS_MODULE: 'geonode.local_settings'
- DOCKER_COMPOSE_VERSION: 1.19.0
- QGIS_SERVER_URL: http://localhost:9000/
- SITEURL: http://localhost:8000/
- QGIS_SERVER_PORT: 9000
- ON_TRAVIS: 'True'
- TEST_RUN_INTERNAL_APPS: 'True'
- MONITORING_ENABLED: 'False'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- CELERY_ALWAYS_EAGER: 'True'
- stage: upload-tests
name: "GeoServer-backend Upload Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.geoserver'
- DOCKER_COMPOSE_VERSION: 1.19.0
- GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
- GEOSERVER_SERVER_PORT: 8080
- ON_TRAVIS: 'True'
- TEST_RUNNER_KEEPDB: 'True'
- TEST_RUN_INTEGRATION: 'True'
- TEST_RUN_INTEGRATION_SERVER: 'False'
- TEST_RUN_INTEGRATION_UPLOAD: 'True'
- TEST_RUN_INTEGRATION_MONITORING: 'False'
- TEST_RUN_INTEGRATION_CSW: 'False'
- TEST_RUN_INTEGRATION_BDD: 'False'
- MONITORING_ENABLED: 'False'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- CELERY_ALWAYS_EAGER: 'True'
- stage: anlytics-tests
name: "GeoServer-backend Monitoring Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.geoserver'
- DOCKER_COMPOSE_VERSION: 1.19.0
- GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
- GEOSERVER_SERVER_PORT: 8080
- ON_TRAVIS: 'True'
- TEST_RUNNER_KEEPDB: 'True'
- TEST_RUN_INTEGRATION: 'True'
- TEST_RUN_INTEGRATION_SERVER: 'False'
- TEST_RUN_INTEGRATION_UPLOAD: 'False'
- TEST_RUN_INTEGRATION_MONITORING: 'True'
- TEST_RUN_INTEGRATION_CSW: 'False'
- TEST_RUN_INTEGRATION_BDD: 'False'
- MONITORING_ENABLED: 'True'
- USER_ANALYTICS_ENABLED: 'True'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- CELERY_ALWAYS_EAGER: 'True'
- stage: integration-tests
name: "Backend Integration Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.geoserver'
- DOCKER_COMPOSE_VERSION: 1.19.0
- GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
- GEOSERVER_SERVER_PORT: 8080
- ON_TRAVIS: 'True'
- TEST_RUNNER_KEEPDB: 'True'
- TEST_RUN_INTEGRATION: 'True'
- TEST_RUN_INTEGRATION_SERVER: 'False'
- TEST_RUN_INTEGRATION_UPLOAD: 'False'
- TEST_RUN_INTEGRATION_MONITORING: 'False'
- TEST_RUN_INTEGRATION_CSW: 'False'
- TEST_RUN_INTEGRATION_BDD: 'False'
- MONITORING_ENABLED: 'False'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- CELERY_ALWAYS_EAGER: 'True'
- stage: integration-tests
name: "GeoServer Integration Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.geoserver'
- DOCKER_COMPOSE_VERSION: 1.19.0
- GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
- GEOSERVER_SERVER_PORT: 8080
- ON_TRAVIS: 'True'
- TEST_RUNNER_KEEPDB: 'True'
- TEST_RUN_INTEGRATION: 'True'
- TEST_RUN_INTEGRATION_SERVER: 'True'
- TEST_RUN_INTEGRATION_UPLOAD: 'False'
- TEST_RUN_INTEGRATION_MONITORING: 'False'
- TEST_RUN_INTEGRATION_CSW: 'False'
- TEST_RUN_INTEGRATION_BDD: 'False'
- MONITORING_ENABLED: 'False'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- CELERY_ALWAYS_EAGER: 'True'
- DATABASE_URL: 'postgis://geonode:geonode@localhost:5432/upload_test'
- GEODATABASE_URL: 'postgis://geonode:geonode@localhost:5432/upload_test'
- DEFAULT_BACKEND_DATASTORE: 'datastore'
- stage: integration-tests
name: "QGis Server Integration Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.qgis_server'
- DJANGO_SETTINGS_MODULE: 'geonode.local_settings'
- DOCKER_COMPOSE_VERSION: 1.19.0
- QGIS_SERVER_URL: http://localhost:9000/
- SITEURL: http://localhost:8000/
- QGIS_SERVER_PORT: 9000
- ON_TRAVIS: 'True'
- TEST_RUNNER_KEEPDB: 'True'
- TEST_RUN_INTEGRATION: 'True'
- TEST_RUN_INTEGRATION_SERVER: 'True'
- MONITORING_ENABLED: 'False'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- CELERY_ALWAYS_EAGER: 'True'
- DATABASE_URL: 'postgis://geonode:geonode@localhost:5432/upload_test'
- GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY: 'leaflet'
- stage: frontend-tests
name: "BDD Tests"
virtualenv:
system_site_packages: false
env:
- BACKEND: 'geonode.geoserver'
- DOCKER_COMPOSE_VERSION: 1.19.0
- GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
- GEOSERVER_SERVER_PORT: 8080
- ON_TRAVIS: 'True'
- TEST_RUN_INTEGRATION: 'False'
- TEST_RUN_INTEGRATION_CSW: 'False'
- TEST_RUN_INTEGRATION_BDD: 'True'
- MONITORING_ENABLED: 'False'
- SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- CELERY_ALWAYS_EAGER: 'True'
- stage: frontend-tests
name: "Selenium Tests Core"
env:
- TEST_RUN_SELENIUM: 'True'
- stage: frontend-tests
name: "Selenium Tests SPCGeoNode"
env:
- TEST_RUN_SELENIUM: 'True'
- SPCGEONODE: 'True'
fast_finish: true
allow_failures:
- name: "Backend Integration Tests"
- name: "Selenium Tests Core"
- name: "Selenium Tests SPCGeoNode"
before_install:
- if [ "$TEST_RUN_SELENIUM" = "True" ]; then
git clone --depth 1 https://github.com/GeoNode/geonode-selenium.git;
export GEONODE_REPOSITORY=$(pwd);
GECKODRIVER_VERSION="v0.24.0";
else
sudo apt-get update;
mkdir -p $HOME/buildout-cache/{eggs,downloads};
scripts/misc/geoserver_server_setup.sh before_install;
scripts/misc/qgis_server_setup.sh before_install;
sudo apt-get autoremove sqlite3;
sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf;
sudo sed -i 's/peer/trust/' /etc/postgresql/12/main/pg_hba.conf;
sudo pg_ctlcluster 12 main restart;
fi
- python --version;
install:
- set -ex;
if [ "$TEST_RUN_INTEGRATION_BDD" = "True" ]; then
/usr/bin/Xvfb :99 -ac -screen 0 1024x768x8 & export DISPLAY=":99";
GECKODRIVER_VERSION="v0.24.0";
wget https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz -O geckodriver.tar.gz;
mkdir bin;
tar zxf geckodriver.tar.gz -C bin;
export PATH=$PATH:$PWD/bin;
fi
- set -ex;
if [ "$TEST_RUN_SELENIUM" = "True" ] && [ "$SPCGEONODE" == "True" ]; then
:;
elif [ "$TEST_RUN_SELENIUM" = "True" ]; then
pip install -r geonode-selenium/requirements.txt --upgrade --no-cache;
wget --no-check-certificate https://download.osgeo.org/geotiff/samples/spot/chicago/UTM2GTIF.TIF -P geonode-selenium/data;
wget --no-check-certificate https://download.osgeo.org/geotiff/samples/made_up/ntf_nord.tif -P geonode-selenium/data;
wget --no-check-certificate https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz -O geckodriver.tar.gz;
mkdir bin;
tar zxf geckodriver.tar.gz -C bin;
export PATH=$PATH:$PWD/bin;
else
sudo apt -qq -y update;
sudo apt install -y build-essential gdal-bin python3.8-dev python3.8-venv virtualenvwrapper libxml2 libxml2-dev gettext libxslt1-dev libjpeg-dev libpng-dev libpq-dev libgdal-dev software-properties-common build-essential git unzip gcc zlib1g-dev libgeos-dev libproj-dev sqlite3 spatialite-bin libsqlite3-mod-spatialite libsqlite3-dev;
sudo apt install -y openjdk-8-jre openjdk-8-jdk;
sudo update-java-alternatives --set java-1.8.0-openjdk-amd64;
export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::");
export PATH=$JAVA_HOME'bin/java':$PATH;
pip install -r requirements.txt --upgrade --no-cache;
pip install -e . --upgrade;
pip install pygdal==`gdal-config --version`.*;
fi;
pip install codecov --no-cache;
before_script:
- set -ex;
if [ "$TEST_RUN_SELENIUM" = "True" ]; then
sudo service nginx stop;
else
echo "Initialize DB";
psql -U postgres -c "create extension postgis";
chmod +x scripts/misc/create_dbs_travis.sh;
scripts/misc/create_dbs_travis.sh before_script;
echo "For GeoServer Server Travis steps";
scripts/misc/geoserver_server_setup.sh before_script;
echo "For QGIS Server Travis steps";
scripts/misc/qgis_server_setup.sh before_script;
echo "Start NGINX server";
sudo nginx -s stop;
sudo nginx -c `pwd`/scripts/misc/nginx_integration.conf;
echo "Setup GeoNode";
paver setup;
fi
script:
- set -ex;
if [ "$TEST_RUN_SELENIUM" = "True" ] && [ "$SPCGEONODE" = "True" ]; then
geonode-selenium/test-docker.sh;
elif [ "$TEST_RUN_SELENIUM" = "True" ]; then
docker-compose -f docker-compose.yml -f docker-compose.override.localhost.yml up --build -d;
URL="http://localhost";
GEONODE_USER=admin GEONODE_PASS=admin GEONODE_URL="$URL" geonode-selenium/test-core.sh;
else
paver run_tests --coverage --local false;
fi
after_script:
- set -ex;
if [ "$TEST_RUN_SELENIUM" = "True" ]; then
true;
else
echo "For GeoServer Server Travis steps";
scripts/misc/geoserver_server_setup.sh after_script;
echo "For QGIS Server Travis steps";
scripts/misc/qgis_server_setup.sh after_script;
echo "Stop NGINX server";
sudo nginx -c `pwd`/scripts/misc/nginx_integration.conf -s stop;
echo "Cleanup";
paver reset_hard;
fi
after_success:
- codecov
- bash <(curl -s https://codecov.io/bash) -t 2c0e7780-1640-45f0-93a3-e103b057d8c8
notifications:
email:
- alessio.fabiani@gmail.com