Run "main" trial tests under poetry (#12438)

* Run "main" trial tests under poetry

Olddeps and twisted trunk tests are handled in separate PRs.

The PyPy config is a best-effort only; it's completely untested.

Pulled out from #12337.

* Changelog
This commit is contained in:
David Robertson 2022-04-12 17:41:21 +01:00 committed by GitHub
parent 58c657322a
commit 5a275a2377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View File

@ -65,23 +65,23 @@ jobs:
matrix: matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"] python-version: ["3.7", "3.8", "3.9", "3.10"]
database: ["sqlite"] database: ["sqlite"]
toxenv: ["py"] extras: ["all"]
include: include:
# Newest Python without optional deps # Newest Python without optional deps
- python-version: "3.10" - python-version: "3.10"
toxenv: "py-noextras" extras: ""
# Oldest Python with PostgreSQL # Oldest Python with PostgreSQL
- python-version: "3.7" - python-version: "3.7"
database: "postgres" database: "postgres"
postgres-version: "10" postgres-version: "10"
toxenv: "py" extras: "all"
# Newest Python with newest PostgreSQL # Newest Python with newest PostgreSQL
- python-version: "3.10" - python-version: "3.10"
database: "postgres" database: "postgres"
postgres-version: "14" postgres-version: "14"
toxenv: "py" extras: "all"
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -93,17 +93,16 @@ jobs:
-e POSTGRES_PASSWORD=postgres \ -e POSTGRES_PASSWORD=postgres \
-e POSTGRES_INITDB_ARGS="--lc-collate C --lc-ctype C --encoding UTF8" \ -e POSTGRES_INITDB_ARGS="--lc-collate C --lc-ctype C --encoding UTF8" \
postgres:${{ matrix.postgres-version }} postgres:${{ matrix.postgres-version }}
- uses: actions/setup-python@v2 - uses: matrix-org/setup-python-poetry@v1
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- run: pip install tox extras: ${{ matrix.extras }}
- name: Await PostgreSQL - name: Await PostgreSQL
if: ${{ matrix.postgres-version }} if: ${{ matrix.postgres-version }}
timeout-minutes: 2 timeout-minutes: 2
run: until pg_isready -h localhost; do sleep 1; done run: until pg_isready -h localhost; do sleep 1; done
- run: tox -e ${{ matrix.toxenv }} - run: poetry run trial --jobs=2 tests
env: env:
TRIAL_FLAGS: "--jobs=2"
SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }} SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }}
SYNAPSE_POSTGRES_HOST: localhost SYNAPSE_POSTGRES_HOST: localhost
SYNAPSE_POSTGRES_USER: postgres SYNAPSE_POSTGRES_USER: postgres
@ -150,23 +149,24 @@ jobs:
trial-pypy: trial-pypy:
# Very slow; only run if the branch name includes 'pypy' # Very slow; only run if the branch name includes 'pypy'
# Note: sqlite only; no postgres. Completely untested since poetry move.
if: ${{ contains(github.ref, 'pypy') && !failure() && !cancelled() }} if: ${{ contains(github.ref, 'pypy') && !failure() && !cancelled() }}
needs: linting-done needs: linting-done
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: ["pypy-3.7"] python-version: ["pypy-3.7"]
extras: ["all"]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
# Install libs necessary for PyPy to build binary wheels for dependencies
- run: sudo apt-get -qq install xmlsec1 libxml2-dev libxslt-dev - run: sudo apt-get -qq install xmlsec1 libxml2-dev libxslt-dev
- uses: actions/setup-python@v2 - uses: matrix-org/setup-python-poetry@v1
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- run: pip install tox extras: ${{ matrix.extras }}
- run: tox -e py - run: poetry run trial --jobs=2 tests
env:
TRIAL_FLAGS: "--jobs=2"
- name: Dump logs - name: Dump logs
# Logs are most useful when the command fails, always include them. # Logs are most useful when the command fails, always include them.
if: ${{ always() }} if: ${{ always() }}

1
changelog.d/12438.misc Normal file
View File

@ -0,0 +1 @@
Run "main" trial tests under `poetry`.