Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# uses: pre-commit/action@v3.0.0

# With no caching at all the entire ci process takes 4m 30s to complete!
pytest:
tests:
runs-on: ubuntu-latest

steps:
Expand All @@ -54,7 +54,10 @@ jobs:
run: docker compose -f local.yml run --rm django python manage.py migrate

- name: Run Django Tests
run: docker compose -f local.yml run django pytest || true
run: docker compose -f local.yml run --rm django python manage.py test --settings=config.settings.test

- name: Run Pytest
run: docker compose -f local.yml run --rm django pytest

- name: Tear down the Stack
run: docker compose -f local.yml down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,19 @@ django_bash: ## Open a bash terminar from django container using $(compose)
@docker compose -f $(compose) run --rm django bash

django_test: ## Run tests from django container using $(compose)
@docker compose -f $(compose) run --rm django python manage.py test
@docker compose -f $(compose) run --rm django python manage.py test --settings=config.settings.test

django_fast: ## Run tests fast from django container using $(compose)
@docker compose -f $(compose) run --rm django python manage.py test --failfast
@docker compose -f $(compose) run --rm django python manage.py test --settings=config.settings.test --failfast

pytest: ## Run pytest from django container using $(compose)
@docker compose -f $(compose) run --rm django pytest

pytest_fast: ## Run pytest stopping on first failure using $(compose)
@docker compose -f $(compose) run --rm django pytest -x

pytest_cov: ## Run pytest with coverage report using $(compose)
@docker compose -f $(compose) run --rm django pytest --cov --cov-report=term-missing

django_makemigrations: ## Run makemigrations from django container using $(compose)
@docker compose -f $(compose) run --rm django python manage.py makemigrations
Expand Down
6 changes: 5 additions & 1 deletion requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ watchgod==0.8.2 # https://github.com/samuelcolvin/watchgod
django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions
django-debug-toolbar # https://github.com/jazzband/django-debug-toolbar

pytest >= 7.0.7
pytest==8.3.5
pytest-django==4.11.1
pytest-cov==6.1.1
coverage==7.8.0
django-coverage-plugin==3.1.0
13 changes: 11 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,16 @@ django_settings_module = config.settings.test
ignore_errors = True

[coverage:run]
include = core/*
omit = *migrations*, *tests*
include =
users/*
core/*
core_settings/*
markup_doc/*
markuplib/*
xml_manager/*
reference/*
tracker/*
model_ai/*
omit = *migrations*, *tests*, */tests/*
plugins =
django_coverage_plugin
9 changes: 7 additions & 2 deletions users/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from django.test import TestCase
from django.test import SimpleTestCase

# Create your tests here.
from users.models import CustomUser


class SmokeTestCase(SimpleTestCase):
def test_custom_user_model_is_configured(self):
self.assertEqual(CustomUser._meta.label, "users.CustomUser")
Loading