Skip to content

Commit

Permalink
temporary: test only e2e with python 3.11 for now
Browse files Browse the repository at this point in the history
  • Loading branch information
afuetterer committed Oct 5, 2023
1 parent 6e53dd4 commit d6451ac
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
43 changes: 31 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
matrix:
python-version: ['3.8', '3.12']
db-backend: [mysql, postgres]
# TODO: e2e-tests require pytest-playwright, which is not yet available for python 3.12
# use 3.11 for e2e-tests for now and remove the following lines as soon as it is supported
include:
- python-version: '3.11'
db-backend: postgres

name: "Test (Python: ${{ matrix.python-version }}, DB: ${{ matrix.db-backend }})"
needs: lint
steps:
Expand Down Expand Up @@ -83,24 +89,37 @@ jobs:
run: |
cp -r testing/media testing/media_root
mkdir testing/log
- name: Run Tests
run: |
pytest -p randomly -p no:cacheprovider --cov --reuse-db --numprocesses=auto --dist=loadscope
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_DB_BACKEND: ${{ matrix.db-backend }}
COVERALLS_FLAG_NAME: '${{ matrix.db-backend }}: ${{ matrix.python-version }}'
COVERALLS_PARALLEL: true
# - name: Run Tests
# run: |
# pytest -p randomly -p no:cacheprovider --cov --reuse-db --numprocesses=auto --dist=loadscope
# coveralls --service=github
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_DB_BACKEND: ${{ matrix.db-backend }}
# COVERALLS_FLAG_NAME: '${{ matrix.db-backend }}: ${{ matrix.python-version }}'
# COVERALLS_PARALLEL: true

# end-to-end tests
# TODO: for now e2e-tests still run on python 3.11
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm install --dev
- run: npm run build:prod
- run: pytest -p randomly -p no:cacheprovider -m e2e
if: matrix.python-version == '3.11' && matrix.db-backend == 'postgres'
- name: Cache Playwright browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright/
key: playwright-browsers
- name: Install e2e tests dependencies
run: |
npm install --dev
npm run build:prod
playwright install chromium
if: matrix.python-version == '3.11' && matrix.db-backend == 'postgres'
- name: Run end-to-end tests
run: pytest -p randomly -p no:cacheprovider --reuse-db -m e2e
if: matrix.python-version == '3.11' && matrix.db-backend == 'postgres'

coveralls:
name: Indicate completion to coveralls
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ pytest = [
"pytest-cov~=4.1",
"pytest-django~=4.5",
"pytest-mock~=3.11",
"pytest-playwright~=0.4.2",
# TODO: e2e-tests require pytest-playwright, which is not yet available for python 3.12
# see: https://github.com/microsoft/playwright-python/issues/2096
"pytest-playwright~=0.4.2; python_version<'3.12'", # TODO: remove <'3.12', once playwright supports 3.12
"pytest-randomly~=3.15",
"pytest-xdist~=3.3",
]
Expand Down

0 comments on commit d6451ac

Please sign in to comment.