FitTrackee/.gitlab-ci.yml

64 lines
1.6 KiB
YAML
Raw Normal View History

2020-09-16 14:13:38 +02:00
image: python:3.8
variables:
POSTGRES_DB: fittrackee_test
POSTGRES_USER: fittrackee
POSTGRES_PASSWORD: fittrackee
POSTGRES_HOST: postgres
APP_SETTINGS: fittrackee.config.TestingConfig
2020-09-16 14:13:38 +02:00
DATABASE_TEST_URL: postgres://fittrackee:fittrackee@postgres:5432/fittrackee_test
EMAIL_URL: smtp://none:none@0.0.0.0:1025
2020-09-17 16:08:57 +02:00
FLASK_APP: fittrackee/__main__.py
2020-09-16 14:13:38 +02:00
SENDER_EMAIL: fittrackee@example.com
services:
- name: postgres:latest
alias: postgres
stages:
- tests
- selenium
.python:
stage: tests
before_script:
- pip install --quiet poetry
- poetry config virtualenvs.create false
- poetry install --no-interaction --quiet
script:
- pytest fittrackee -p no:warnings --cov fittrackee --cov-report term-missing
2020-09-16 14:13:38 +02:00
lint:
extends: .python
script:
- pytest --flake8 --isort --black -m "flake8 or isort or black" fittrackee e2e --ignore=fittrackee/migrations
2020-09-16 14:13:38 +02:00
python-3.7:
extends: .python
image: python:3.7
python-3.8:
extends: .python
2020-11-22 12:04:57 +01:00
python-3.9:
extends: .python
2020-11-22 12:04:57 +01:00
image: python:3.9
2020-09-16 14:13:38 +02:00
firefox:
stage: selenium
services:
- name: postgres:latest
alias: postgres
- name: selenium/standalone-firefox
alias: selenium
before_script:
- pip install --quiet poetry
- poetry config virtualenvs.create false
- poetry install --no-interaction --quiet
- flask db upgrade --directory fittrackee/migrations
2020-09-17 16:08:57 +02:00
- flask init-data
2020-09-16 14:13:38 +02:00
- setsid nohup flask run --with-threads -h 0.0.0.0 -p 5000 >> nohup.out 2>&1 &
- export TEST_APP_URL=http://$(hostname --ip-address):5000
- sleep 5
script:
- pytest e2e --driver Remote --capability browserName firefox --host selenium --port 4444