summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-12-01 11:48:20 +0000
committerMark Haines <mark.haines@matrix.org>2015-12-01 11:48:20 +0000
commita33c0748e3ba82e789557858519cf8561ed86f9c (patch)
treeb65239d76490d1a3901b4b8632c5ddf7561c24d8
parentRun sytest against postgresql if appropriate databases exist for it to run ag... (diff)
downloadsynapse-a33c0748e3ba82e789557858519cf8561ed86f9c.tar.xz
Use a PORT_BASE environment variable to configure the ports that sytest uses
Diffstat (limited to '')
-rwxr-xr-xjenkins.sh16
1 files changed, 4 insertions, 12 deletions
diff --git a/jenkins.sh b/jenkins.sh
index d4f8e06bc2..63d80ab355 100755
--- a/jenkins.sh
+++ b/jenkins.sh
@@ -42,22 +42,14 @@ 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
+: ${PORT_BASE:=8000}
 
 echo >&2 "Running sytest with SQLite3";
-./run-tests.pl -O tap --synapse-directory .. --all > results.tap
+./run-tests.pl -O tap --synapse-directory .. --all --port-base $PORT_BASE > results.tap
 
 RUN_POSTGRES=""
 
-for port in 800{1,2}; do
+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
@@ -69,7 +61,7 @@ EOF
 done
 
 # Run if both postgresql databases exist
-if test $RUN_POSTGRES = ":8001:8002"; then
+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 > results.tap