diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8cb21eb9..fad7c4586 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: matrix: os: [ubuntu-20.04] python-version: [3.8] - toxenv: [django32, django42, integration-django32, integration-django42, quality-django32, quality-django42, translations-django32, translations-django42] + toxenv: [py38-django32, py38-django42, integration-django32, integration-django42, quality, translations-django32, translations-django42] steps: - name: checkout repo @@ -43,13 +43,13 @@ jobs: # `libgtk2.0-0` and `libxt6` are required by an older version of Firefox. - name: Install Required System Packages - if: matrix.toxenv == 'integration' + if: ${{ startsWith(matrix.toxenv, 'integration') }} run: | sudo apt-get update sudo apt-get install -y libxmlsec1-dev ubuntu-restricted-extras xvfb libxml2-dev libxslt-dev libevent-dev libgtk2.0-0 libxt6 - name: Install translations dependencies - if: matrix.toxenv == 'translations' + if: ${{ startsWith(matrix.toxenv, 'translations') }} run: | sudo apt-get update sudo apt-get install -y gettext diff --git a/Makefile b/Makefile index d86f817fa..a13024bd4 100644 --- a/Makefile +++ b/Makefile @@ -111,8 +111,8 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy $(PIP_COMPILE) -o requirements/workbench.txt requirements/workbench.in $(PIP_COMPILE) -o requirements/ci.txt requirements/ci.in $(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in - sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp - mv requirements/test.tmp requirements/test.txt + sed -i '/^[dD]jango==/d' requirements/test.txt + sed -i '/^[dD]jango==/d' requirements/workbench.txt mysql: ## run mysql database for integration tests docker run --rm -it --name mysql -p 3307:3306 -e MYSQL_ROOT_PASSWORD=rootpw -e MYSQL_DATABASE=db mysql:8 diff --git a/requirements/workbench.txt b/requirements/workbench.txt index abb7f8917..2c18426c1 100644 --- a/requirements/workbench.txt +++ b/requirements/workbench.txt @@ -59,7 +59,6 @@ coverage[toml]==7.2.7 # pytest-cov ddt==1.6.0 # via -r requirements/test.txt -django==3.2.19 # via # -r requirements/test.txt # django-appconf diff --git a/tox.ini b/tox.ini index fd9889f6a..f41696c24 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{32,42},quality-django{32,42},integration-django{32,42},translations-django{32,42} +envlist = py38-django{32,42},quality,integration-django{32,42},translations-django{32,42} [pycodestyle] exclude = .git,.tox @@ -27,13 +27,26 @@ commands = mkdir -p var pytest {posargs:tests/unit/ --cov drag_and_drop_v2} -[testenv:integration] +[testenv:integration-django32] allowlist_externals = make xvfb-run deps = - django32: Django>=3.2,<4.0 - django42: Django>=4.2,<4.3 + Django>=3.2,<4.0 + -r{toxinidir}/requirements/workbench.txt +setenv = + PATH = test_helpers/firefox{:}{env:PATH} + WORKBENCH_DATABASES = \{"default": \{"ENGINE": "django.db.backends.mysql", "NAME": "db", "USER": "root", "PASSWORD": "rootpw", "HOST": "127.0.0.1", "PORT": "3307"\}\} +commands = + make install_firefox + xvfb-run ./run_tests.py {posargs:tests.integration} + +[testenv:integration-django42] +allowlist_externals = + make + xvfb-run +deps = + Django>=4.2,<4.3 -r{toxinidir}/requirements/workbench.txt setenv = PATH = test_helpers/firefox{:}{env:PATH} @@ -44,20 +57,26 @@ commands = [testenv:quality] deps = - django32: Django>=3.2,<4.0 - django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/quality.txt commands = pycodestyle drag_and_drop_v2 tests manage.py setup.py --max-line-length=120 pylint drag_and_drop_v2 pylint tests --rcfile=tests/pylintrc -[testenv:translations] +[testenv:translations-django32] allowlist_externals = make deps = - django32: Django>=3.2,<4.0 - django42: Django>=4.2,<4.3 + Django>=3.2,<4.0 + -r{toxinidir}/requirements/test.txt +commands = + make check_translations_up_to_date + +[testenv:translations-django42] +allowlist_externals = + make +deps = + Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt commands = make check_translations_up_to_date