This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add CI job to act as a canary for testing against latest dependencies #12472
Merged
Merged
Changes from 25 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
7667444
WIP pip install from wheel job
b28c551
Try to run action?
0a591a1
Try to run postgres tests too
6715324
Install package whoopsie
96e228d
sytest?
ea9cf7f
Changelog
da400f1
sytest on postgres too
094f310
Trypy mypy
5b2ddcc
Notes and fixes
3fbcf54
Actually upgrade packages
52cce2c
Clarify comment
293c1ee
Commit to running mypy in this job
efda082
Make sure we `poetry run pip`
76aca20
Paranoia: single pip invocation
93652a0
Try to only update runtime packages, not dev deps
e6b786e
Comment justifying strategy
643444d
Debug: why is mypy not reading config?
71ab574
Back to export
54e9dd6
Another attempt
522906c
No, we really should use `pip`
0c22165
Confirm uninstall
9d1ead3
Try just using poetry
c841847
try beta poetry
715fb1b
Update comment
d0819a9
Typo fix
54d368c
Try `trial` without installing in editable mode
0b57eb9
Another attempt at trial
81b98b3
Third attempt at trial
36ef3c2
Update job description comment
b2f6da2
Enable the issue-raiser; remove debug
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: CI run against latest deps is failing | ||
--- | ||
See https://github.com/{{env.GITHUB_REPOSITORY}}/actions/runs/{{env.GITHUB_RUN_ID}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
# People who are freshly `pip install`ing from PyPI will pull in the latest versions of all | ||
# dependencies. Since most CI runs are against the locked poetry environment, run | ||
# specifically against the latest dependencies to know if there's an upcoming breaking | ||
# change. | ||
# | ||
# To plug that hole, this job is a canary which periodically | ||
# - checks out develop, | ||
# - pip installs from source (building a wheel locally using `poetry-core`, | ||
# and `pip install`ing from that), and | ||
# - runs test suites against that checkout. | ||
# | ||
# Based on the twisted trunk CI job. | ||
|
||
name: Latest dependencies | ||
|
||
on: | ||
schedule: | ||
- cron: 0 7 * * * | ||
pull_request: | ||
branches: [dmr/poetry-wheel-ci] | ||
push: | ||
branches: [dmr/poetry-wheel-ci] | ||
DMRobertson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
mypy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# The dev dependencies aren't exposed in the wheel metadata (at least with current | ||
# poetry-core versions), so we install with poetry. | ||
- uses: matrix-org/setup-python-poetry@v1 | ||
with: | ||
python-version: "3.x" | ||
poetry-version: "1.2.0b1" | ||
# Dump installed versions for debugging. | ||
- run: poetry run pip list > before.txt | ||
# Upgrade all runtime dependencies only. This is intended to mimic a fresh | ||
# `pip install matrix-synapse[all]` as closely as possible. | ||
DMRobertson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- run: poetry update --no-dev | ||
- run: poetry run pip list > after.txt && (diff -u before.txt after.txt || true) | ||
- run: poetry run mypy | ||
trial: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- database: "sqlite" | ||
- database: "postgres" | ||
postgres-version: "14" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: sudo apt-get -qq install xmlsec1 | ||
- name: Set up PostgreSQL ${{ matrix.postgres-version }} | ||
if: ${{ matrix.postgres-version }} | ||
run: | | ||
docker run -d -p 5432:5432 \ | ||
-e POSTGRES_PASSWORD=postgres \ | ||
-e POSTGRES_INITDB_ARGS="--lc-collate C --lc-ctype C --encoding UTF8" \ | ||
postgres:${{ matrix.postgres-version }} | ||
DMRobertson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
- run: pip install -e .[all,test] | ||
|
||
- name: Await PostgreSQL | ||
if: ${{ matrix.postgres-version }} | ||
timeout-minutes: 2 | ||
run: until pg_isready -h localhost; do sleep 1; done | ||
- run: trial --jobs=2 tests | ||
env: | ||
SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }} | ||
SYNAPSE_POSTGRES_HOST: localhost | ||
SYNAPSE_POSTGRES_USER: postgres | ||
SYNAPSE_POSTGRES_PASSWORD: postgres | ||
- name: Dump logs | ||
# Logs are most useful when the command fails, always include them. | ||
if: ${{ always() }} | ||
# Note: Dumps to workflow logs instead of using actions/upload-artifact | ||
# This keeps logs colocated with failing jobs | ||
# It also ignores find's exit code; this is a best effort affair | ||
run: >- | ||
find _trial_temp -name '*.log' | ||
-exec echo "::group::{}" \; | ||
-exec cat {} \; | ||
-exec echo "::endgroup::" \; | ||
|| true | ||
|
||
|
||
sytest: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: matrixdotorg/sytest-synapse:testing | ||
volumes: | ||
- ${{ github.workspace }}:/src | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- sytest-tag: focal | ||
|
||
- sytest-tag: focal | ||
postgres: postgres | ||
workers: workers | ||
redis: redis | ||
env: | ||
POSTGRES: ${{ matrix.postgres && 1}} | ||
WORKERS: ${{ matrix.workers && 1 }} | ||
REDIS: ${{ matrix.redis && 1 }} | ||
BLACKLIST: ${{ matrix.workers && 'synapse-blacklist-with-workers' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Ensure sytest runs `pip install` | ||
# Delete the lockfile so sytest will `pip install` rather than `poetry install` | ||
run: rm /src/poetry.lock | ||
working-directory: /src | ||
- name: Prepare test blacklist | ||
run: cat sytest-blacklist .ci/worker-blacklist > synapse-blacklist-with-workers | ||
- name: Run SyTest | ||
run: /bootstrap.sh synapse | ||
working-directory: /src | ||
- name: Summarise results.tap | ||
if: ${{ always() }} | ||
run: /sytest/scripts/tap_to_gha.pl /logs/results.tap | ||
- name: Upload SyTest logs | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ always() }} | ||
with: | ||
name: Sytest Logs - ${{ job.status }} - (${{ join(matrix.*, ', ') }}) | ||
path: | | ||
/logs/results.tap | ||
/logs/**/*.log* | ||
|
||
|
||
# TODO: run complement (as with twisted trunk, see #12473). | ||
|
||
# open an issue if the build fails, so we know about it. | ||
# open-issue: | ||
# if: failure() | ||
# needs: | ||
# # TODO: should mypy be included here? It feels more brittle than the other two. | ||
# - mypy | ||
# - trial | ||
# - sytest | ||
# | ||
# runs-on: ubuntu-latest | ||
# | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - uses: JasonEtco/create-an-issue@5d9504915f79f9cc6d791934b8ef34f2353dd74d # v2.5.0, 2020-12-06 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# update_existing: true | ||
# filename: .ci/latest_deps_build_failed_issue_template.md | ||
DMRobertson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add a CI job which tests Synapse against the latest version of all dependencies. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.