Skip to content

Commit

Permalink
[#2933] Run select tests sequentially
Browse files Browse the repository at this point in the history
    - Certain tests fail intermittently in CI but pass consistently
      on local machines when run sequentially. The commit introduces
      a tag to collect these tests and run them on their own.
  • Loading branch information
Paul Schilling committed Dec 20, 2024
1 parent 4ddcd7f commit b2df509
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
test-type: [main, elastic, openklant]
test-type: [main, elastic, openklant, sequential]

services:
postgres:
Expand Down Expand Up @@ -67,11 +67,14 @@ jobs:
src/manage.py test src \
--parallel \
--exclude-tag=e2e \
--exclude-tag=elastic
--exclude-tag=elastic \
--exclude-tag=sequential
elif [ "${{ matrix.test-type }}" = "elastic" ]; then
coverage run -p src/manage.py test src --tag=elastic --exclude-tag=e2e
elif [ "${{ matrix.test-type }}" = "openklant" ]; then
coverage run -m pytest --block-network --record-mode=none -vvv src/openklant2
elif [ "${{ matrix.test-type }}" = "sequential" ]; then
coverage run -p src/manage.py test src --tag=sequential
else
echo "Error: Unknown test type '${{ matrix.test-type }}'"
exit 1
Expand Down
3 changes: 2 additions & 1 deletion src/open_inwoner/openklant/tests/test_signal.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.contrib.auth import user_logged_in
from django.test import RequestFactory
from django.test import RequestFactory, tag

import requests_mock
from django_webtest import WebTest
Expand All @@ -19,6 +19,7 @@
from open_inwoner.utils.tests.helpers import AssertTimelineLogMixin


@tag("sequential")
@requests_mock.Mocker()
class UpdateUserFromLoginSignalAPITestCase(
ClearCachesMixin, DisableRequestLogMixin, AssertTimelineLogMixin, WebTest
Expand Down

0 comments on commit b2df509

Please sign in to comment.