Commit 65b7ca16 authored by Bengfort's avatar Bengfort
Browse files

setup tests

parent db7533e3
...@@ -19,10 +19,10 @@ test-branch: ...@@ -19,10 +19,10 @@ test-branch:
image: $PYTHON_IMAGE image: $PYTHON_IMAGE
script: script:
- apt-get update -q && apt-get install -y -qq $PYTHON_IMAGE_DEPENDENCIES - apt-get update -q && apt-get install -y -qq $PYTHON_IMAGE_DEPENDENCIES
- pip3 install -e . - pip3 install -e .[test]
- pip3 install flake8
- flake8 - flake8
- django-admin makemigrations --dry-run --check --noinput --settings=scheduler.settings.development - django-admin makemigrations --dry-run --check --noinput --settings=scheduler.settings.development
- django-admin test --settings=scheduler.settings.development
build: build:
stage: build stage: build
......
...@@ -12,12 +12,17 @@ run: ...@@ -12,12 +12,17 @@ run:
install: install:
if [ ! -d "$(VIRTUAL_ENV)" ]; then python3 -m venv "$(VIRTUAL_ENV)"; fi if [ ! -d "$(VIRTUAL_ENV)" ]; then python3 -m venv "$(VIRTUAL_ENV)"; fi
$(VIRTUAL_ENV)/bin/pip install -U pip $(VIRTUAL_ENV)/bin/pip install -U pip
$(VIRTUAL_ENV)/bin/pip install -e . $(VIRTUAL_ENV)/bin/pip install -e .[test]
npm install npm install
$(MANAGEPY) migrate $(MANAGEPY) migrate
$(MANAGEPY) shell -c "from django.contrib.auth.models import User; User.objects.filter(username='admin').exists() or User.objects.create_superuser('admin', 'admin@example.com', 'password')" $(MANAGEPY) shell -c "from django.contrib.auth.models import User; User.objects.filter(username='admin').exists() or User.objects.create_superuser('admin', 'admin@example.com', 'password')"
$(MANAGEPY) compilemessages -l de $(MANAGEPY) compilemessages -l de
.PHONY: test
test:
$(VIRTUAL_ENV)/bin/flake8 scheduler
$(MANAGEPY) test
.PHONY: makemessages .PHONY: makemessages
makemessages: makemessages:
$(MANAGEPY) makemessages -l de -d django $(MANAGEPY) makemessages -l de -d django
......
...@@ -13,6 +13,11 @@ install_requires = ...@@ -13,6 +13,11 @@ install_requires =
django-npm == 1.0.0 django-npm == 1.0.0
requests == 2.25.1 requests == 2.25.1
[options.extras_require]
test =
model-bakery
flake8
[flake8] [flake8]
exclude = exclude =
.venv, .venv,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment