|
@@ -25,17 +25,19 @@ python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml
|
|
|
echo "--- Prepare test database"
|
|
|
|
|
|
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
|
|
|
-scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
|
|
+update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
|
|
|
|
|
# Create the PostgreSQL database.
|
|
|
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
|
|
|
|
|
|
echo "+++ Run synapse_port_db against test database"
|
|
|
-coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
|
|
+# TODO: this invocation of synapse_port_db (and others below) used to be prepended with `coverage run`,
|
|
|
+# but coverage seems unable to find the entrypoints installed by `pip install -e .`.
|
|
|
+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.
|
|
|
echo "+++ Run synapse_port_db a second time"
|
|
|
-coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
|
|
+synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
|
|
|
|
|
#####
|
|
|
|
|
@@ -46,7 +48,7 @@ echo "--- Prepare empty SQLite database"
|
|
|
# we do this by deleting the sqlite db, and then doing the same again.
|
|
|
rm .ci/test_db.db
|
|
|
|
|
|
-scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
|
|
+update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
|
|
|
|
|
|
# re-create the PostgreSQL database.
|
|
|
.ci/scripts/postgres_exec.py \
|
|
@@ -54,4 +56,4 @@ scripts/update_synapse_database --database-config .ci/sqlite-config.yaml --run-b
|
|
|
"CREATE DATABASE synapse"
|
|
|
|
|
|
echo "+++ Run synapse_port_db against empty database"
|
|
|
-coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|
|
|
+synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
|