mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-14 14:01:59 +01:00
ea01d4c2de
- Use sytest:bionic. Sytest:latest is two years old (do we want CI to push out latest at all?) and comes with Python 3.5, which we explictly no longer support. The script now runs under PostgreSQL 10 as a result. - Advertise script in the docs - Move pg testing script to scripts-dev directory - Write to host as the script's exector, not root A few changes to make it speedier to re-run the tests: - Create blank DB in the container, not the script, so we don't have to `initdb` each time - Use a named volume to persist the tox environment, so we don't have to fetch and install a bunch of packages from PyPI each time Co-authored-by: reivilibre <olivier@librepush.net>
19 lines
616 B
Bash
Executable file
19 lines
616 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# This script runs the PostgreSQL tests inside a Docker container. It expects
|
|
# the relevant source files to be mounted into /src (done automatically by the
|
|
# caller script). It will set up the database, run it, and then use the tox
|
|
# configuration to run the tests.
|
|
|
|
set -e
|
|
|
|
# Set PGUSER so Synapse's tests know what user to connect to the database with
|
|
export PGUSER=postgres
|
|
|
|
# Start the database
|
|
sudo -u postgres /usr/lib/postgresql/10/bin/pg_ctl -w -D /var/lib/postgresql/data start
|
|
|
|
# Run the tests
|
|
cd /src
|
|
export TRIAL_FLAGS="-j 4"
|
|
tox --workdir=./.tox-pg-container -e py36-postgres "$@"
|