summary refs log tree commit diff
path: root/jenkins.sh
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-12-01 13:25:44 +0000
committerMark Haines <mjark@negativecurvature.net>2015-12-01 13:25:44 +0000
commitc91a05776f404675da94dd2f2838f3d8e48774b5 (patch)
treef4fdcd2101b201f4352e99eb35e44e2196d58445 /jenkins.sh
parentMerge pull request #399 from matrix-org/erikj/search (diff)
parentWrite the tap results for each database to different files when running sytest (diff)
downloadsynapse-c91a05776f404675da94dd2f2838f3d8e48774b5.tar.xz
Merge pull request #398 from matrix-org/markjh/jenkins_postgres
Run sytest against postgresql
Diffstat (limited to '')
-rwxr-xr-xjenkins.sh27
1 files changed, 26 insertions, 1 deletions
diff --git a/jenkins.sh b/jenkins.sh
index 8d2ac63c56..0018ca610a 100755
--- a/jenkins.sh
+++ b/jenkins.sh
@@ -42,4 +42,29 @@ export PERL5LIB PERL_MB_OPT PERL_MM_OPT
 
 ./install-deps.pl
 
-./run-tests.pl -O tap --synapse-directory .. --all > results.tap
+: ${PORT_BASE:=8000}
+
+echo >&2 "Running sytest with SQLite3";
+./run-tests.pl -O tap --synapse-directory .. --all --port-base $PORT_BASE > results-sqlite3.tap
+
+RUN_POSTGRES=""
+
+for port in $(($PORT_BASE + 1)) $(($PORT_BASE + 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 = ":$(($PORT_BASE + 1)):$(($PORT_BASE + 2))"; then
+    echo >&2 "Running sytest with PostgreSQL";
+    pip install psycopg2
+    ./run-tests.pl -O tap --synapse-directory .. --all --port-base $PORT_BASE > results-postgresql.tap
+else
+    echo >&2 "Skipping running sytest with PostgreSQL, $RUN_POSTGRES"
+fi