mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-25 11:05:49 +03:00
d4c4798a25
On NixOS, `bash` isn't under `/bin/bash` but rather in some directory in `$PATH`. Locally, I've been patching those scripts to make them work. `/usr/bin/env` seems to be the only [portable way](https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my) to use binaries from the PATH as interpreters. Signed-off-by: Quentin Gliech <quentingliech@gmail.com>
20 lines
773 B
Bash
Executable file
20 lines
773 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
|
|
|
|
# Initialise & start the database
|
|
su -c '/usr/lib/postgresql/9.6/bin/initdb -D /var/lib/postgresql/data -E "UTF-8" --lc-collate="en_US.UTF-8" --lc-ctype="en_US.UTF-8" --username=postgres' postgres
|
|
su -c '/usr/lib/postgresql/9.6/bin/pg_ctl -w -D /var/lib/postgresql/data start' postgres
|
|
|
|
# Run the tests
|
|
cd /src
|
|
export TRIAL_FLAGS="-j 4"
|
|
tox --workdir=/tmp -e py35-postgres
|