custom postgres launcher for tests

From: Ivan Taranov <i(dot)taranov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: custom postgres launcher for tests
Date: 2020-02-11 10:53:32
Message-ID: CAKqLMA8V-ktRznYapXD=f903AX1A9+hqz8mf=ky3jufMG8Vd-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This patch allow to use custom postgres launcher for tests (tap&regress)
by setting environment variable PGLAUNCHER.

Other known methods (like: https://wiki.postgresql.org/wiki/Valgrind)
requires
to perform installation, build system modifications, executable replacement
etc...

And proposed way is simpler and more flexible.

** Use-case: run checks under Valgrind

- prepare launcher

echo 'exec valgrind postgres "$@"' > /tmp/pgvalgrind
chmod +x /tmp/pgvalgrind

- execute regress tests under Valgrind

PGLAUNCHER=/tmp/pgvalgrind TESTS=gin make check-tests

- execute concrete tap-test under Valgrind

PGLAUNCHER=/tmp/pgvalgrind PROVE_TESTS=t/001_stream_rep.pl make \
check -C src/test/recovery

** Use-case: execute tests with different postgres versions

- prepare multi-launcher

cat <<EOF > /tmp/launcher
cp -f `pwd`/src/backend/postgres.v* \`pg_config --bindir\`
exec postgres.v\$V "\$@"
EOF
chmod +x /tmp/launcher

- make some versions of postgres binary

./configure "CFLAGS=..." && make
mv src/backend/postgres src/backend/postgres.v1

./configure "CFLAGS=..." && make
mv src/backend/postgres src/backend/postgres.v2

- run checks with different postgres binaries

PGLAUNCHER=/tmp/launcher V=1 make check -C contrib/bloom
PGLAUNCHER=/tmp/launcher V=2 make check -C contrib/bloom

Attachment Content-Type Size
custom_launcher_v1.patch text/x-patch 2.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-02-11 11:45:25 Re: ERROR: subtransaction logged without previous top-level txn record
Previous Message ROS Didier 2020-02-11 10:23:30 open-source equivalent of golden-gate