From: Peter Eisentraut Date: Mon, 5 Aug 2019 07:23:28 +0000 (+0200) Subject: Travis CI: Add test run with Valgrind X-Git-Tag: pgbouncer_1_11_0~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66b6dc2c31f7360e11347b20216c6c7ec5ce13cf;p=pgbouncer Travis CI: Add test run with Valgrind 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 --- diff --git a/.travis.yml b/.travis.yml index fc52a21..06a4bea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/test/ssl/test.sh b/test/ssl/test.sh index fb6c457..a3e5b34 100755 --- a/test/ssl/test.sh +++ b/test/ssl/test.sh @@ -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 diff --git a/test/test.sh b/test/test.sh index d424dbf..3a52fef 100755 --- a/test/test.sh +++ b/test/test.sh @@ -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