summary refs log tree commit diff
path: root/scripts-dev/test_postgresql.sh
blob: 43cfa256e4daeaf11c8e561286de360a531245f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash

# This script builds the Docker image to run the PostgreSQL tests, and then runs
# the tests. It uses a dedicated tox environment so that we don't have to
# rebuild it each time.

# Command line arguments to this script are forwarded to "tox" and then to "trial".

set -e

# Build, and tag
docker build docker/ \
  --build-arg "UID=$(id -u)" \
  --build-arg "GID=$(id -g)" \
  -f docker/Dockerfile-pgtests \
  -t synapsepgtests

# Run, mounting the current directory into /src
docker run --rm -it -v "$(pwd):/src" -v synapse-pg-test-tox:/tox synapsepgtests "$@"