Skip to content

Commit

Permalink
Fix broken tests (#109)
Browse files Browse the repository at this point in the history
* Restrict pytest version to <6.1, so it works with pytest-rerunfailures

This is a temporary fix.
See pytest-dev/pytest-rerunfailures#128

* Restricted 'djangocms-text-ckeditor' to versions below 4.0.0 

djangocms-text-ckeditor>=4 is for the not yet released django-cms>=3.8

* Raise action versions and add coverage.xml generation
  • Loading branch information
s-weigand authored Sep 27, 2020
1 parent 5b735c2 commit 10bf3d8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
62 changes: 32 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: "Tests"
name: 'Tests'
on: [push, pull_request]

jobs:
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
Expand All @@ -21,9 +21,9 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
Expand All @@ -38,9 +38,9 @@ jobs:
docs-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
Expand All @@ -61,17 +61,17 @@ jobs:
python-version: [3.6, 3.7, 3.8]
version_combinations:
[
{ "django": 1.11, "cms": 3.4 },
{ "django": 1.11, "cms": 3.5 },
{ "django": 1.11, "cms": 3.6 },
{ "django": 1.11, "cms": 3.7 },
{ "django": 2.1, "cms": 3.7 },
{ "django": 2.1, "cms": 3.6 },
{ "django": 2.2, "cms": 3.7 },
{ 'django': 1.11, 'cms': 3.4 },
{ 'django': 1.11, 'cms': 3.5 },
{ 'django': 1.11, 'cms': 3.6 },
{ 'django': 1.11, 'cms': 3.7 },
{ 'django': 2.1, 'cms': 3.7 },
{ 'django': 2.1, 'cms': 3.6 },
{ 'django': 2.2, 'cms': 3.7 },
]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
Expand All @@ -86,7 +86,7 @@ jobs:
docker-compose up -d
docker-compose ps
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -105,11 +105,12 @@ jobs:

- name: Run tests django==${{ matrix.version_combinations.django }} && django-cms==${{ matrix.version_combinations.cms }}
env:
PYTEST_ARGS: "-vv --reruns 10"
PYTEST_ARGS: '-vv --reruns 10'
run: |
coverage erase
coverage run setup.py test
coverage report
coverage xml
- name: Upload Screenshots Artifact on fail
if: failure()
Expand All @@ -126,8 +127,8 @@ jobs:
if: matrix.version_combinations.django == 2.2 && matrix.version_combinations.cms == 3.7 && matrix.python-version == 3.7 && (github.ref == 'refs/heads/master' || github.base_ref == 'master' )
uses: percy/snapshot-action@v0.1.1
with:
build-directory: "test_screenshots"
flags: "-c .ci.percy.yml"
build-directory: 'test_screenshots'
flags: '-c .ci.percy.yml'
verbose: true
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
Expand All @@ -143,16 +144,16 @@ jobs:
matrix:
version_combinations:
[
{ "django": 1.11, "cms": 3.4 },
{ "django": 1.11, "cms": 3.5 },
{ "django": 1.11, "cms": 3.6 },
{ "django": 1.11, "cms": 3.7 },
{ "django": 2.1, "cms": 3.6 },
{ "django": 2.1, "cms": 3.7 },
{ 'django': 1.11, 'cms': 3.4 },
{ 'django': 1.11, 'cms': 3.5 },
{ 'django': 1.11, 'cms': 3.6 },
{ 'django': 1.11, 'cms': 3.7 },
{ 'django': 2.1, 'cms': 3.6 },
{ 'django': 2.1, 'cms': 3.7 },
]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
Expand All @@ -167,7 +168,7 @@ jobs:
docker-compose up -d
docker-compose ps
- name: Set up Python 3.5
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.5

Expand All @@ -183,11 +184,12 @@ jobs:

- name: Run tests django==${{ matrix.version_combinations.django }} && django-cms==${{ matrix.version_combinations.cms }}
env:
PYTEST_ARGS: "-vv --reruns 10"
PYTEST_ARGS: '-vv --reruns 10'
run: |
coverage erase
coverage run setup.py test
coverage report
coverage xml
- name: Upload Screenshots Artifact on fail
if: failure()
Expand All @@ -205,7 +207,7 @@ jobs:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
needs: [test-py36-38, test-py35]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
Expand All @@ -215,7 +217,7 @@ jobs:
npm ci
npm run publish
- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ recommonmark>=0.6.0
# tests
django-app-helper>=2.2.2
selenium>=3.141.0
pytest>=5.1.3
pytest>=5.1.3,<6.1
pytest-django>=3.9.0
pytest-rerunfailures>=9.0
coverage>=4.5.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
requirements = [
"django-cms>=3.4,<3.8",
"django>=1.11,!=2.0.*,<3.0",
"djangocms-text-ckeditor>=3.2.1",
"djangocms-text-ckeditor>=3.2.1,<4.0.0",
]

setup(
Expand Down

0 comments on commit 10bf3d8

Please sign in to comment.