Remove buildkite from portdb CI tests

This commit is contained in:
David Robertson 2021-08-10 13:11:43 +01:00
parent c5988a8eb7
commit 58e5da5aa0
6 changed files with 17 additions and 23 deletions

View File

@ -1,8 +1,8 @@
[run] [run]
branch = True branch = True
parallel = True parallel = True
include=$TOP/synapse/* include=$GITHUB_WORKSPACE/synapse/*
data_file = $TOP/.coverage data_file = $GITHUB_WORKSPACE/.coverage
[report] [report]
precision = 2 precision = 2

View File

@ -278,13 +278,7 @@ jobs:
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Patch Buildkite-specific test scripts - run: ci/scripts/test_synapse_port_db.sh
run: |
sed -i -e 's/host="postgres"/host="localhost"/' .buildkite/scripts/postgres_exec.py
sed -i -e 's/host: postgres/host: localhost/' .buildkite/postgres-config.yaml
sed -i -e 's|/src/||' .buildkite/{sqlite,postgres}-config.yaml
sed -i -e 's/\$TOP/\$GITHUB_WORKSPACE/' .coveragerc
- run: .buildkite/scripts/test_synapse_port_db.sh
complement: complement:
if: ${{ !failure() && !cancelled() }} if: ${{ !failure() && !cancelled() }}

View File

@ -3,7 +3,7 @@
# CI's Docker setup at the point where this file is considered. # CI's Docker setup at the point where this file is considered.
server_name: "localhost:8800" server_name: "localhost:8800"
signing_key_path: ".buildkite/test.signing.key" signing_key_path: "ci/test.signing.key"
report_stats: false report_stats: false
@ -11,7 +11,7 @@ database:
name: "psycopg2" name: "psycopg2"
args: args:
user: postgres user: postgres
host: postgres host: localhost
password: postgres password: postgres
database: synapse database: synapse

View File

@ -23,7 +23,7 @@ import psycopg2
# We use "postgres" as a database because it's bound to exist and the "synapse" one # We use "postgres" as a database because it's bound to exist and the "synapse" one
# doesn't exist yet. # doesn't exist yet.
db_conn = psycopg2.connect( db_conn = psycopg2.connect(
user="postgres", host="postgres", password="postgres", dbname="postgres" user="postgres", host="localhost", password="postgres", dbname="postgres"
) )
db_conn.autocommit = True db_conn.autocommit = True
cur = db_conn.cursor() cur = db_conn.cursor()

View File

@ -20,22 +20,22 @@ pip install -e .
echo "--- Generate the signing key" echo "--- Generate the signing key"
# Generate the server's signing key. # Generate the server's signing key.
python -m synapse.app.homeserver --generate-keys -c .buildkite/sqlite-config.yaml python -m synapse.app.homeserver --generate-keys -c ci/sqlite-config.yaml
echo "--- Prepare test database" echo "--- Prepare test database"
# Make sure the SQLite3 database is using the latest schema and has no pending background update. # Make sure the SQLite3 database is using the latest schema and has no pending background update.
scripts-dev/update_database --database-config .buildkite/sqlite-config.yaml scripts-dev/update_database --database-config ci/sqlite-config.yaml
# Create the PostgreSQL database. # Create the PostgreSQL database.
./.buildkite/scripts/postgres_exec.py "CREATE DATABASE synapse" ./ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
echo "+++ Run synapse_port_db against test database" echo "+++ Run synapse_port_db against test database"
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml coverage run scripts/synapse_port_db --sqlite-database ci/test_db.db --postgres-config ci/postgres-config.yaml
# We should be able to run twice against the same database. # We should be able to run twice against the same database.
echo "+++ Run synapse_port_db a second time" echo "+++ Run synapse_port_db a second time"
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml coverage run scripts/synapse_port_db --sqlite-database ci/test_db.db --postgres-config ci/postgres-config.yaml
##### #####
@ -44,14 +44,14 @@ coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --p
echo "--- Prepare empty SQLite database" echo "--- Prepare empty SQLite database"
# we do this by deleting the sqlite db, and then doing the same again. # we do this by deleting the sqlite db, and then doing the same again.
rm .buildkite/test_db.db rm ci/test_db.db
scripts-dev/update_database --database-config .buildkite/sqlite-config.yaml scripts-dev/update_database --database-config ci/sqlite-config.yaml
# re-create the PostgreSQL database. # re-create the PostgreSQL database.
./.buildkite/scripts/postgres_exec.py \ ./ci/scripts/postgres_exec.py \
"DROP DATABASE synapse" \ "DROP DATABASE synapse" \
"CREATE DATABASE synapse" "CREATE DATABASE synapse"
echo "+++ Run synapse_port_db against empty database" echo "+++ Run synapse_port_db against empty database"
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml coverage run scripts/synapse_port_db --sqlite-database ci/test_db.db --postgres-config ci/postgres-config.yaml

View File

@ -3,14 +3,14 @@
# schema and run background updates on it. # schema and run background updates on it.
server_name: "localhost:8800" server_name: "localhost:8800"
signing_key_path: ".buildkite/test.signing.key" signing_key_path: "ci/test.signing.key"
report_stats: false report_stats: false
database: database:
name: "sqlite3" name: "sqlite3"
args: args:
database: ".buildkite/test_db.db" database: "ci/test_db.db"
# Suppress the key server warning. # Suppress the key server warning.
trusted_key_servers: [] trusted_key_servers: []