Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elnappo committed Mar 8, 2019
1 parent 474bc82 commit a1ee209
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,15 @@ test:
- mdillon/postgis:latest
variables:
POSTGRES_DB: test
POSTGRES_PASSWORD: postgres
stage: test
image: "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG"
image: ubuntu:rolling
script:
- setup_test_db
- /code/docker-entrypoint.sh test
- ./tools/install_requirements.sh
- pip3 install --requirement requirements.txt
- cd project_novis
- pytest
artifacts:
reports:
junit: report.xml
Expand Down Expand Up @@ -795,6 +799,7 @@ rollout 100%:
else
DB_HOST=localhost
fi
DB_HOST=postgis
export DATABASE_URL="postgis://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOST}:5432/${POSTGRES_DB}"
}

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:rolling

ENV PYTHONUNBUFFERED=1
ENV VIRTUAL_ENV /venv
Expand Down
1 change: 1 addition & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ case "$1" in
;;
gunicorn)
echo "Starting Django application via Gunicorn"
# Disable access log?
exec gunicorn -b :8000 --worker-class gevent --worker-connections 20 --timeout 10 --graceful-timeout 30 --access-logfile - wsgi
;;
help)
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ DJANGO_SETTINGS_MODULE = settings
# -- recommended but optional:
python_files = tests.py test_*.py *_tests.py
junit_family = xunit2
addopts = --reuse-db --cov-report term --cov=project_novis --junitxml=report.xml
addopts = --verbose --reuse-db --cov-report term --cov=project_novis --junitxml=report.xml
20 changes: 20 additions & 0 deletions tools/install_requirements.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -o errexit # abort script at first error
set -o pipefail # return the exit status of the last command in the pipe
set -o nounset # treat unset variables and parameters as an error

apt-get update && apt-get dist-upgrade --assume-yes && apt-get install --assume-yes --no-install-recommends\
bash \
git \
python3-minimal \
python3-venv \
python3-pip \
python3-setuptools \
locales \
binutils \
libproj-dev \
gdal-bin \
python3-dev \
libpq-dev \
gcc

0 comments on commit a1ee209

Please sign in to comment.