Skip to content

Commit

Permalink
Try to add celery in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tut-tuuut committed Nov 14, 2024
1 parent 9634411 commit d31e4dc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis

env:
DATABASE_URL: "postgres://${{ vars.DATABASE_USER }}:${{ vars.DATABASE_PASSWORD }}@${{ vars.DATABASE_HOST }}:${{ vars.DATABASE_PORT }}/${{ vars.DATABASE_NAME }}"
Expand Down
8 changes: 8 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pytest

pytest_plugins = ("celery.contrib.pytest",)


@pytest.fixture(scope="session")
def celery_config():
return {"broker_url": "redis://", "result_backend": "redis://"}
6 changes: 5 additions & 1 deletion gsl_demarches_simplifiees/tests/test_dossier_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
Dossier,
)

pytestmark = pytest.mark.django_db
pytestmark = [
pytest.mark.django_db,
pytest.mark.usefixtures("celery_session_app"),
pytest.mark.usefixtures("celery_session_worker"),
]


@pytest.fixture
Expand Down

0 comments on commit d31e4dc

Please sign in to comment.