Skip to content

Commit

Permalink
Merge branch 'master' into geoserver_web_ui_location
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Fabiani authored Jan 31, 2019
2 parents 8a1c0c6 + 6a1692f commit ef455ac
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 103 deletions.
173 changes: 111 additions & 62 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
sudo: required
sudo: false

language: python

cache:
pip: true
directories:
- $HOME/.cache/pip
- $HOME/buildout-cache

before_cache:
- rm -f $HOME/.cache/pip/log/debug.log

python:
- "2.7"

virtualenv:
system_site_packages: true

Expand All @@ -28,63 +26,113 @@ addons:
- postgresql-9.6-postgis-2.3
- nginx

env:
- BACKEND: 'geonode.geoserver'
ON_TRAVIS: 'True'
TEST_RUN_CORE: 'True'
MONITORING_ENABLED: 'False'
- BACKEND: 'geonode.geoserver'
ON_TRAVIS: 'True'
TEST_RUN_INTERNAL_APPS: 'True'
MONITORING_ENABLED: 'False'
- BACKEND: 'geonode.geoserver'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is GeoServer server address
GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
GEOSERVER_SERVER_PORT: 8080
ON_TRAVIS: 'True'
TEST_RUN_INTEGRATION: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- BACKEND: 'geonode.qgis_server'
DJANGO_SETTINGS_MODULE: 'geonode.local_settings'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_CORE: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- BACKEND: 'geonode.qgis_server'
DJANGO_SETTINGS_MODULE: 'geonode.local_settings'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_INTERNAL_APPS: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- BACKEND: 'geonode.qgis_server'
DJANGO_SETTINGS_MODULE: 'geonode.local_settings'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_INTEGRATION: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
matrix:
fast_finish: true
include:
- name: "GeoServer-backend Core Modules Smoke Tests"
python: 2.7
env:
- BACKEND: 'geonode.geoserver'
ON_TRAVIS: 'True'
TEST_RUN_CORE: 'True'
MONITORING_ENABLED: 'False'
- name: "GeoServer-backend Contrib Apps Smoke Tests"
python: 2.7
env:
- BACKEND: 'geonode.geoserver'
ON_TRAVIS: 'True'
TEST_RUN_INTERNAL_APPS: 'True'
MONITORING_ENABLED: 'False'
- name: "GeoServer-backend Integration Tests"
python: 2.7
env:
- BACKEND: 'geonode.geoserver'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is GeoServer server address
GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
GEOSERVER_SERVER_PORT: 8080
ON_TRAVIS: 'True'
TEST_RUN_INTEGRATION: 'True'
TEST_RUN_INTEGRATION_CSW: 'False'
TEST_RUN_INTEGRATION_BDD: 'False'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- name: "GeoServer-backend Integration CSW Tests"
python: 2.7
env:
- BACKEND: 'geonode.geoserver'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is GeoServer server address
GEOSERVER_SERVER_URL: http://localhost:8080/geoserver/
GEOSERVER_SERVER_PORT: 8080
ON_TRAVIS: 'True'
TEST_RUN_INTEGRATION: 'False'
TEST_RUN_INTEGRATION_CSW: 'True'
TEST_RUN_INTEGRATION_BDD: 'False'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- name: "GeoServer-backend Integration BDD Tests"
python: 2.7
env:
- BACKEND: 'geonode.geoserver'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is GeoServer server address
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'
CELERY_ALWAYS_EAGER: 'True'
- name: "QGis Server-backend Core Modules Smoke Tests"
python: 2.7
env:
- BACKEND: 'geonode.qgis_server'
DJANGO_SETTINGS_MODULE: 'geonode.local_settings'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_CORE: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- name: "QGis Server-backend Contrib Apps Smoke Tests"
python: 2.7
env:
- BACKEND: 'geonode.qgis_server'
DJANGO_SETTINGS_MODULE: 'geonode.local_settings'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_INTERNAL_APPS: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'
- name: "QGis Server-backend Integration Tests"
python: 2.7
env:
- BACKEND: 'geonode.qgis_server'
DJANGO_SETTINGS_MODULE: 'geonode.local_settings'
DOCKER_COMPOSE_VERSION: 1.19.0
# This is qgis server address
QGIS_SERVER_URL: http://localhost:9000/
# This is the location of docker network bridge
# So QGIS server can access this address
SITEURL: http://localhost:8000/
QGIS_SERVER_PORT: 9000
ON_TRAVIS: 'True'
TEST_RUN_INTEGRATION: 'True'
MONITORING_ENABLED: 'False'
CELERY_ALWAYS_EAGER: 'True'

branches:
only:
Expand All @@ -93,6 +141,7 @@ branches:
- 2.6.x

before_install:
- mkdir -p $HOME/buildout-cache/{eggs,downloads}
- scripts/misc/geoserver_server_setup.sh before_install
- scripts/misc/qgis_server_setup.sh before_install
- chmod +x scripts/misc/bdd_setup.sh
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2.2'
services:

db:
image: geonode/postgis:9.6
image: geonode/postgis:10
restart: unless-stopped
container_name: db4${COMPOSE_PROJECT_NAME}
stdin_open: true
Expand Down
2 changes: 2 additions & 0 deletions geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,8 @@
core_tests = ast.literal_eval(os.environ.get('TEST_RUN_CORE', 'False'))
internal_apps_tests = ast.literal_eval(os.environ.get('TEST_RUN_INTERNAL_APPS', 'False'))
integration_tests = ast.literal_eval(os.environ.get('TEST_RUN_INTEGRATION', 'False'))
integration_csw_tests = ast.literal_eval(os.environ.get('TEST_RUN_INTEGRATION_CSW', 'False'))
integration_bdd_tests = ast.literal_eval(os.environ.get('TEST_RUN_INTEGRATION_BDD', 'False'))

# Setting a custom test runner to avoid running the tests for
# some problematic 3rd party apps
Expand Down
88 changes: 48 additions & 40 deletions pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
core_tests,
internal_apps_tests,
integration_tests,
integration_csw_tests,
integration_bdd_tests,
INSTALLED_APPS,
GEONODE_CORE_APPS,
GEONODE_INTERNAL_APPS,
Expand Down Expand Up @@ -139,31 +141,35 @@ def setup_geoserver(options):
jetty_runner = download_dir / \
os.path.basename(dev_config['JETTY_RUNNER_URL'])

grab(
options.get(
'geoserver',
dev_config['GEOSERVER_URL']),
geoserver_bin,
"geoserver binary")
grab(
options.get(
'jetty',
dev_config['JETTY_RUNNER_URL']),
jetty_runner,
"jetty runner")

if not geoserver_dir.exists():
geoserver_dir.makedirs()

webapp_dir = geoserver_dir / 'geoserver'
if not webapp_dir:
webapp_dir.makedirs()

print 'extracting geoserver'
z = zipfile.ZipFile(geoserver_bin, "r")
z.extractall(webapp_dir)
if _django_11 and (integration_tests or integration_csw_tests or integration_bdd_tests):
"""Will make use of the docker container for the Integration Tests"""
pass
else:
grab(
options.get(
'geoserver',
dev_config['GEOSERVER_URL']),
geoserver_bin,
"geoserver binary")
grab(
options.get(
'jetty',
dev_config['JETTY_RUNNER_URL']),
jetty_runner,
"jetty runner")

_install_data_dir()
if not geoserver_dir.exists():
geoserver_dir.makedirs()

webapp_dir = geoserver_dir / 'geoserver'
if not webapp_dir:
webapp_dir.makedirs()

print 'extracting geoserver'
z = zipfile.ZipFile(geoserver_bin, "r")
z.extractall(webapp_dir)

_install_data_dir()


@task
Expand Down Expand Up @@ -388,7 +394,7 @@ def updategeoip(options):

@task
@cmdopts([
('settings', 's', 'Specify custom DJANGO_SETTINGS_MODULE')
('settings=', 's', 'Specify custom DJANGO_SETTINGS_MODULE')
])
def sync(options):
"""
Expand Down Expand Up @@ -477,7 +483,7 @@ def package(options):
('bind=', 'b', 'Bind server to provided IP address and port number.'),
('java_path=', 'j', 'Full path to java install for Windows'),
('foreground', 'f', 'Do not run in background but in foreground'),
('settings', 's', 'Specify custom DJANGO_SETTINGS_MODULE')
('settings=', 's', 'Specify custom DJANGO_SETTINGS_MODULE')
], share_with=['start_django', 'start_geoserver'])
def start():
"""
Expand All @@ -503,7 +509,7 @@ def stop_geoserver():
Stop GeoServer
"""
# we use docker-compose for integration tests
if integration_tests:
if integration_tests or integration_csw_tests or integration_bdd_tests:
return

# only start if using Geoserver backend
Expand Down Expand Up @@ -630,7 +636,7 @@ def start_geoserver(options):
Start GeoServer with GeoNode extensions
"""
# we use docker-compose for integration tests
if integration_tests:
if integration_tests or integration_csw_tests or integration_bdd_tests:
return

# only start if using Geoserver backend
Expand Down Expand Up @@ -817,7 +823,7 @@ def test_javascript(options):
@task
@cmdopts([
('name=', 'n', 'Run specific tests.'),
('settings', 's', 'Specify custom DJANGO_SETTINGS_MODULE')
('settings=', 's', 'Specify custom DJANGO_SETTINGS_MODULE')
])
def test_integration(options):
"""
Expand Down Expand Up @@ -912,21 +918,23 @@ def run_tests(options):
prefix = 'python'
local = options.get('local', 'false') # travis uses default to false

if not integration_tests:
if not integration_tests and not integration_csw_tests and not integration_bdd_tests:
sh('%s manage.py test geonode.tests.smoke %s %s' % (prefix, _keepdb, _parallel))
call_task('test', options={'prefix': prefix})
else:
call_task('test_integration')
call_task('test_integration', options={'name': 'geonode.tests.csw'})
if integration_tests:
call_task('test_integration')

# only start if using Geoserver backend
_backend = os.environ.get('BACKEND', OGC_SERVER['default']['BACKEND'])
if _backend == 'geonode.geoserver' and 'geonode.geoserver' in INSTALLED_APPS:
call_task('test_integration',
options={'name': 'geonode.upload.tests.integration',
'settings': 'geonode.upload.tests.test_settings'})
# only start if using Geoserver backend
_backend = os.environ.get('BACKEND', OGC_SERVER['default']['BACKEND'])
if _backend == 'geonode.geoserver' and 'geonode.geoserver' in INSTALLED_APPS:
call_task('test_integration',
options={'name': 'geonode.upload.tests.integration'})
elif integration_csw_tests:
call_task('test_integration', options={'name': 'geonode.tests.csw'})

call_task('test_bdd', options={'local': local})
if integration_bdd_tests:
call_task('test_bdd', options={'local': local})

sh('flake8 geonode')

Expand Down Expand Up @@ -962,7 +970,7 @@ def reset_hard():
@task
@cmdopts([
('type=', 't', 'Import specific data type ("vector", "raster", "time")'),
('settings', 's', 'Specify custom DJANGO_SETTINGS_MODULE')
('settings=', 's', 'Specify custom DJANGO_SETTINGS_MODULE')
])
def setup_data():
"""
Expand Down
19 changes: 19 additions & 0 deletions travis.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[buildout]
extends =
base.cfg
plone-x.x.x.cfg
solr.cfg
solr-x.x.x.cfg
versions.cfg
parts +=
code-analysis

# caches, see also .travis.yaml
# one should not depend on '/home/travis' but it seems stable in containers.
eggs-directory = /home/travis/buildout-cache/eggs
download-cache = /home/travis/buildout-cache/downloads

[code-analysis]
recipe = plone.recipe.codeanalysis
pre-commit-hook = False
# return-status-codes = True

0 comments on commit ef455ac

Please sign in to comment.