FitTrackee/.gitlab-ci.yml

73 lines
1.7 KiB
YAML
Raw Normal View History

2021-01-31 18:40:20 +01:00
image: python:3.9
2020-09-16 14:13:38 +02:00
variables:
POSTGRES_DB: fittrackee_test
POSTGRES_USER: fittrackee
POSTGRES_PASSWORD: fittrackee
POSTGRES_HOST: postgres
APP_SETTINGS: fittrackee.config.TestingConfig
2021-04-06 13:15:26 +02:00
DATABASE_TEST_URL: postgresql://fittrackee:fittrackee@postgres:5432/fittrackee_test
2020-09-16 14:13:38 +02:00
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
2021-01-02 19:28:03 +01:00
type-check:
extends: .python
script:
2021-01-31 18:40:20 +01:00
- mypy fittrackee
2021-01-02 19:28:03 +01:00
2020-09-16 14:13:38 +02:00
python-3.7:
extends: .python
image: python:3.7
python-3.8:
extends: .python
2021-01-31 18:40:20 +01:00
image: python:3.8
2020-09-16 14:13:38 +02:00
2020-11-22 12:04:57 +01:00
python-3.9:
extends: .python
2021-10-20 09:10:56 +02:00
python-3.10:
extends: .python
image: python:3.10
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