diff --git a/.github/workflows/run_django_tests.yaml b/.github/workflows/run_django_tests.yaml index c8be28ff..30d0a006 100644 --- a/.github/workflows/run_django_tests.yaml +++ b/.github/workflows/run_django_tests.yaml @@ -62,7 +62,9 @@ jobs: AWS_ACCESS_KEY_ID: sampleaccesskey AWS_SECRET_ACCESS_KEY: samplesecretkey AWS_REGION: us-east-1 - run: coverage run src/manage.py test meshapi meshapi_hooks + run: | + coverage run -a src/manage.py test meshapi meshapi_hooks --tag skip_on_parallel && + coverage run -a src/manage.py test meshapi meshapi_hooks --parallel 4 --exclude-tag skip_on_parallel - name: Write coverage report to disk run: coverage html - name: Upload coverage reports to Codecov diff --git a/pyproject.toml b/pyproject.toml index 3e9eab57..0a2b8209 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,6 +69,7 @@ dev = [ "beautifulsoup4==4.12.*", "freezegun==1.5.1", "moto[s3]==5.0.*", + "tblib==3.0.*", ] [project.scripts] diff --git a/src/meshapi/tests/test_join_form.py b/src/meshapi/tests/test_join_form.py index 37ecf58e..9bf7453c 100644 --- a/src/meshapi/tests/test_join_form.py +++ b/src/meshapi/tests/test_join_form.py @@ -7,7 +7,7 @@ import requests_mock from django.contrib.auth.models import User from django.db.models import Q -from django.test import Client, TestCase, TransactionTestCase +from django.test import Client, TestCase, TransactionTestCase, tag from parameterized import parameterized from meshapi.models import Building, Install, Member, Node @@ -1127,6 +1127,7 @@ def slow_install_init(*args, **kwargs): @patch("meshapi.views.forms.DISABLE_RECAPTCHA_VALIDATION", True) +@tag("skip_on_parallel") class TestJoinFormRaceCondition(TransactionTestCase): c = Client() admin_c = Client() diff --git a/src/meshapi_hooks/tests/test_webhooks.py b/src/meshapi_hooks/tests/test_webhooks.py index 4aa99ed4..113f88ed 100644 --- a/src/meshapi_hooks/tests/test_webhooks.py +++ b/src/meshapi_hooks/tests/test_webhooks.py @@ -9,7 +9,7 @@ multiprocessing.set_start_method("fork") from celery.contrib.testing.worker import start_worker -from django.test import TransactionTestCase +from django.test import TransactionTestCase, tag from meshapi.models import Building, Install, Member from meshapi.tests.sample_data import sample_building, sample_install, sample_member @@ -48,6 +48,7 @@ def respond_bad(): flask_app.run(host="127.0.0.1", port=8091, debug=False) +@tag("skip_on_parallel") class TestMeshAPIWebhooks(TransactionTestCase): @classmethod def setUpClass(cls):