]> granicus.if.org Git - pgbouncer/commitdiff
Travis CI: Add test run with Valgrind
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 5 Aug 2019 07:23:28 +0000 (09:23 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 5 Aug 2019 07:23:28 +0000 (09:23 +0200)
Note: Valgrind on Ubuntu xenial is broken for OpenSSL[0], so don't
configure that right now.  Travis CI on bionic still has issues[1], so
we're stuck here for now.

[0]: https://bugs.launchpad.net/ubuntu/+source/valgrind/+bug/1574437
[1]: https://travis-ci.community/t/apt-addon-doesnt-run-in-bionic/4061

.travis.yml
test/ssl/test.sh
test/test.sh

index fc52a21c84a5780b2a7ff2c9454be8a4a497e012..06a4bea555703576c3e3936a0120c541f3d0f30e 100644 (file)
@@ -13,6 +13,7 @@ addons:
       - lintian
       - pandoc
       - python
+      - valgrind
 compiler:
   - clang
   - gcc
@@ -26,7 +27,8 @@ env:
     - configure_args='--with-pam'
     - configure_args='--with-openssl'
     - configure_args='--without-openssl'
-    - configure_args='--with-openssl --with-pam' use_efence=yes
+    - use_efence=yes   configure_args='--with-openssl --with-pam'
+    - use_valgrind=yes configure_args='--without-openssl --with-pam'
 script: |
   set -e
   PATH=/usr/lib/postgresql/9.5/bin:$PATH
@@ -40,10 +42,19 @@ script: |
       export LD_PRELOAD=/usr/lib/libefence.so
       export EF_ALLOW_MALLOC_0=1
     fi
+    if [ x"$use_valgrind" = x"yes" ]; then
+      export BOUNCER_EXE_PREFIX="valgrind --quiet --track-origins=yes --read-var-info=yes --error-markers=VALGRIND-ERROR-BEGIN,VALGRIND-ERROR-END --log-file=$HOME/valgrind.%p.log"
+    fi
     (cd test/ && ./test.sh)
     if echo x"$configure_args" | grep -q with-openssl; then
       (cd test/ssl/ && ./test.sh)
     fi
+    if [ x"$use_valgrind" = x"yes" ]; then
+      if grep -q VALGRIND-ERROR $HOME/valgrind.*.log; then
+        cat $HOME/valgrind.*.log
+        exit 1
+      fi
+    fi
   )
   make install
   make dist
index fb6c457c709a2bf0ce22a1a133e519aed2c13ad1..a3e5b34af69aa7ebc05dc636f59265e70c1c0dda 100755 (executable)
@@ -23,7 +23,7 @@ BOUNCER_LOG=test.log
 BOUNCER_INI=test.ini
 BOUNCER_PID=test.pid
 BOUNCER_PORT=`sed -n '/^listen_port/s/listen_port.*=[^0-9]*//p' $BOUNCER_INI`
-BOUNCER_EXE="../../pgbouncer"
+BOUNCER_EXE="$BOUNCER_EXE_PREFIX ../../pgbouncer"
 
 LOGDIR=log
 PG_PORT=6666
index d424dbf2791ec805bf46948c3034634066f4c5b1..3a52fefbc6ad14670501e65ae100768b8c4327b7 100755 (executable)
@@ -16,7 +16,7 @@ BOUNCER_LOG=test.log
 BOUNCER_INI=test.ini
 BOUNCER_PID=test.pid
 BOUNCER_PORT=`sed -n '/^listen_port/s/listen_port.*=[^0-9]*//p' $BOUNCER_INI`
-BOUNCER_EXE="../pgbouncer"
+BOUNCER_EXE="$BOUNCER_EXE_PREFIX ../pgbouncer"
 
 LOGDIR=log
 PG_PORT=6666