diff --git a/.circleci/config.yml b/.circleci/config.yml index 991563754..607782a97 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,8 @@ jobs: - run: make assets # Uruchamiaj na lokalnym firefoxie używając jednego CPU - - run: pytest -n 2 --cov=src --splinter-webdriver=firefox --nginx-host=localhost --liveserver=localhost + - run: pytest -n 2 --cov=src --splinter-webdriver=firefox --nginx-host=localhost --liveserver=localhost -m "not serial" + - run: pytest -n 0 --splinter-webdriver=firefox --nginx-host=localhost --liveserver=localhost -m "serial" # Testy JavaScript - run: make js-tests diff --git a/Makefile b/Makefile index 943294e73..fd4708241 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,8 @@ jenkins: pipenv install -d make assets - pytest --ds=django_bpp.settings.local -n6 --splinter-webdriver=firefox --nginx-host=localhost --liveserver=localhost --create-db --maxfail=20 + pytest -m "not serial" --ds=django_bpp.settings.local -n6 --splinter-webdriver=firefox --nginx-host=localhost --liveserver=localhost --create-db --maxfail=20 + pytest -m "serial" --ds=django_bpp.settings.local -n0 --splinter-webdriver=firefox --nginx-host=localhost --liveserver=localhost --create-db --maxfail=20 yarn make js-tests diff --git a/Pipfile b/Pipfile index e8c3c8be0..dd8b742a3 100644 --- a/Pipfile +++ b/Pipfile @@ -79,7 +79,7 @@ sphinx-autobuild = "==0.7.1" pdbpp = "==0.9.1" coveralls = "==1.10.0" psutil = "==5.4.5" -pytest = "*" +pytest = "==5.3.2" pytest-django = "*" pytest-cov = "*" pytest-localserver = "*" diff --git a/src/bpp/tests/tests_legacy/test_commands.py b/src/bpp/tests/tests_legacy/test_commands.py index 62bc1e73c..53d828644 100644 --- a/src/bpp/tests/tests_legacy/test_commands.py +++ b/src/bpp/tests/tests_legacy/test_commands.py @@ -1,3 +1,4 @@ +import pytest from model_mommy import mommy from django.core.management import call_command @@ -21,6 +22,7 @@ def test_afiliacja(self): afiliacja(d1, kw) self.assertEqual(kw['recenzowana'], False) + @pytest.mark.serial def test_rebuild_cache(self): mommy.make(Wydawnictwo_Ciagle) - call_command("rebuild_cache") \ No newline at end of file + call_command("rebuild_cache")