Skip to content

Commit

Permalink
chore: Update tests to avoid running setup test (#174)
Browse files Browse the repository at this point in the history
* Update test.yml

* Update tox.ini

* Update test.yml

* Update tox.ini

* Update settings.py

* Update base.txt

* Update tests/settings.py

* Update tests/settings.py

* Update README.rst

* Update test.yml

* Update test.yml

* Update test.yml
  • Loading branch information
fsbraun authored Nov 30, 2024
1 parent 531abc5 commit 1dd7a53
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
django-version: ['3.2', '4.0', '4.1']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
django-version: ['3.2', '4.2', '5.0', '5.1']
os: [
ubuntu-20.04,
ubuntu-latest
]

exclude:
- django-version: '5.0'
python-version: '3.9'
- django-version: '5.1'
python-version: '3.9'
- django-version: '3.2'
python-version: '3.13'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -23,11 +29,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install django==${{ matrix.django-version }} coverage
pip install django~=${{ matrix.django-version }} coverage
pip install -r tests/requirements/base.txt
python setup.py install
- name: Run coverage
run: coverage run setup.py test
run: coverage run tests/settings.py

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v1
Expand All @@ -43,7 +50,7 @@ jobs:
'https://github.com/django/django/archive/main.tar.gz'
]
os: [
ubuntu-20.04,
ubuntu-latest,
]

steps:
Expand All @@ -57,10 +64,11 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install ${{ matrix.django-version }} coverage
pip install -r tests/requirements/base.txt
python setup.py install
- name: Run coverage
run: coverage run setup.py test
run: coverage run tests/settings.py
continue-on-error: true

- name: Upload Coverage to Codecov
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ You can run tests by executing::
.. |coverage| image:: https://codecov.io/gh/divio/django-sekizai/branch/master/graph/badge.svg
:target: https://codecov.io/gh/divio/django-sekizai

.. |python| image:: https://img.shields.io/badge/python-3.5+-blue.svg
.. |python| image:: https://img.shields.io/badge/python-3.9+-blue.svg
:target: https://pypi.org/project/django-sekizai/
.. |django| image:: https://img.shields.io/badge/django-2.2,%203.0,%203.1-blue.svg
.. |django| image:: https://img.shields.io/badge/django-4.2,%205.0,%205.1-blue.svg
:target: https://www.djangoproject.com/
1 change: 1 addition & 0 deletions tests/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
tox
coverage
flake8
setuptools
2 changes: 2 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@ def run():


if __name__ == '__main__':
# Add current directory to python path - works if this script is called python tests/settings,.py
sys.path.insert(0, '.')
run()
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ skip_missing_interpreters=True
deps =
-r{toxinidir}/tests/requirements/base.txt
dj32: Django>=3.2,<3.3
dj40: Django>=4.0,<4.1
dj41: Django>=4.1,<4.2
dj42: Django>=4.2,<5.0
dj42: Django>=4.2,<4.3
dj50: Django>=5.0,<5.1
dj51: Django>=5.1,<5.2
djmain: https://github.com/django/django/archive/main.tar.gz
commands =
{envpython} --version
{env:COMMAND:coverage} erase
{env:COMMAND:coverage} run setup.py test
{env:COMMAND:coverage} run tests/settings.py
{env:COMMAND:coverage} report
ignore_outcome =
djmain: True
Expand Down

0 comments on commit 1dd7a53

Please sign in to comment.