summary refs log tree commit diff
path: root/jenkins.sh
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-11-26 16:50:44 +0000
committerMark Haines <mark.haines@matrix.org>2015-11-26 16:50:44 +0000
commitf280726037195912fe5f7ad7c1af37f6a2271767 (patch)
tree682f2f11bd52c453dd8bd135c5bcdec7e8f06908 /jenkins.sh
parentMerge pull request #397 from matrix-org/erikj/redaction_inequality (diff)
downloadsynapse-f280726037195912fe5f7ad7c1af37f6a2271767.tar.xz
Run sytest against postgresql if appropriate databases exist for it to run against
Diffstat (limited to 'jenkins.sh')
-rwxr-xr-xjenkins.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/jenkins.sh b/jenkins.sh
index 8d2ac63c56..d4f8e06bc2 100755
--- a/jenkins.sh
+++ b/jenkins.sh
@@ -42,4 +42,37 @@ export PERL5LIB PERL_MB_OPT PERL_MM_OPT
 
 ./install-deps.pl
 
+for port in 800{1,2}; do
+    if test -e localhost-$port/database.yaml; then
+        cat > localhost-$port/database.yaml << EOF
+name: sqlite3
+args:
+    database: ':memory:'
+EOF
+    fi
+done
+
+echo >&2 "Running sytest with SQLite3";
 ./run-tests.pl -O tap --synapse-directory .. --all > results.tap
+
+RUN_POSTGRES=""
+
+for port in 800{1,2}; do
+    if psql synapse_jenkins_$port <<< ""; then
+        RUN_POSTGRES=$RUN_POSTGRES:$port
+        cat > localhost-$port/database.yaml << EOF
+name: psycopg2
+args:
+    database: synapse_jenkins_$port
+EOF
+    fi
+done
+
+# Run if both postgresql databases exist
+if test $RUN_POSTGRES = ":8001:8002"; then
+    echo >&2 "Running sytest with PostgreSQL";
+    pip install psycopg2
+    ./run-tests.pl -O tap --synapse-directory .. --all > results.tap
+else
+    echo >&2 "Skipping running sytest with PostgreSQL, $RUN_POSTGRES"
+fi