55# - runs the port script on a prepopulated test sqlite db
66# - also runs it against an new sqlite db
77
8+ # Expects Synapse to have been already installed with `poetry install -e .[postgres]
89
910set -xe
1011cd " $( dirname " $0 " ) /../.."
1112
12- echo " --- Install dependencies"
13-
14- # Install dependencies for this test.
15- pip install psycopg2 coverage coverage-enable-subprocess
16-
17- # Install Synapse itself. This won't update any libraries.
18- pip install -e .
19-
2013echo " --- Generate the signing key"
2114
2215# Generate the server's signing key.
23- python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
16+ poetry run synapse_homeserver --generate-keys -c .ci/sqlite-config.yaml
2417
2518echo " --- Prepare test database"
2619
2720# Make sure the SQLite3 database is using the latest schema and has no pending background update.
28- update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
21+ poetry run update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
2922
3023# Create the PostgreSQL database.
31- .ci/scripts/postgres_exec.py " CREATE DATABASE synapse"
24+ poetry run .ci/scripts/postgres_exec.py " CREATE DATABASE synapse"
3225
3326echo " +++ Run synapse_port_db against test database"
3427# TODO: this invocation of synapse_port_db (and others below) used to be prepended with `coverage run`,
3528# but coverage seems unable to find the entrypoints installed by `pip install -e .`.
36- synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
29+ poetry run synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
3730
3831# We should be able to run twice against the same database.
3932echo " +++ Run synapse_port_db a second time"
40- synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
33+ poetry run synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
4134
4235# ####
4336
@@ -48,12 +41,12 @@ echo "--- Prepare empty SQLite database"
4841# we do this by deleting the sqlite db, and then doing the same again.
4942rm .ci/test_db.db
5043
51- update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
44+ poetry run update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
5245
5346# re-create the PostgreSQL database.
54- .ci/scripts/postgres_exec.py \
47+ poetry run .ci/scripts/postgres_exec.py \
5548 " DROP DATABASE synapse" \
5649 " CREATE DATABASE synapse"
5750
5851echo " +++ Run synapse_port_db against empty database"
59- synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
52+ poetry run synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
0 commit comments