Skip to content

Commit

Permalink
test: add Django 4.2
Browse files Browse the repository at this point in the history
Co-authored-by: Awais Qureshi <[email protected]>
Co-authored-by: Usama Sadiq <[email protected]>
Co-authored-by: Agrendalath <[email protected]>
  • Loading branch information
4 people committed Jul 10, 2023
1 parent b98a9fd commit 2125ae3
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: [3.8]
toxenv: [py38, integration, quality, translations]
toxenv: [py38-django32, py38-django42, integration-django32, integration-django42, quality, translations-django32, translations-django42]

steps:
- name: checkout repo
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +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 -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
Expand Down
1 change: 0 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ coverage[toml]==7.2.7
# via pytest-cov
ddt==1.6.0
# via -r requirements/test.in
django==3.2.20
# via
# -r requirements/base.txt
# django-appconf
Expand Down
1 change: 0 additions & 1 deletion requirements/workbench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ coverage[toml]==7.2.7
# pytest-cov
ddt==1.6.0
# via -r requirements/test.txt
django==3.2.20
# via
# -r requirements/test.txt
# django-appconf
Expand Down
33 changes: 30 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38
envlist = py38-django{32,42},quality,integration-django{32,42},translations-django{32,42}

[pycodestyle]
exclude = .git,.tox
Expand All @@ -20,16 +20,33 @@ allowlist_externals =
make
mkdir
deps =
django32: Django>=3.2,<4.0
django42: Django>=4.2,<4.3
-r{toxinidir}/requirements/test.txt
commands =
mkdir -p var
pytest {posargs:tests/unit/ --cov drag_and_drop_v2}

[testenv:integration]
[testenv:integration-django32]
allowlist_externals =
make
xvfb-run
deps =
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}
Expand All @@ -46,10 +63,20 @@ commands =
pylint drag_and_drop_v2
pylint tests --rcfile=tests/pylintrc

[testenv:translations]
[testenv:translations-django32]
allowlist_externals =
make
deps =
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

0 comments on commit 2125ae3

Please sign in to comment.