custom postgres launcher for tests

Поиск
Список
Период
Сортировка
От Ivan Taranov
Тема custom postgres launcher for tests
Дата
Msg-id CAKqLMA8V-ktRznYapXD=f903AX1A9+hqz8mf=ky3jufMG8Vd-g@mail.gmail.com
обсуждение исходный текст
Ответы Re: custom postgres launcher for tests  (Craig Ringer <craig@2ndquadrant.com>)
Список 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
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: ROS Didier
Дата:
Сообщение: open-source equivalent of golden-gate
Следующее
От: Andy Fan
Дата:
Сообщение: Re: [PATCH] Erase the distinctClause if the result is unique by definition