aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2024-02-15 09:52:08 +0100
committerPeter Eisentraut <peter@eisentraut.org>2024-02-15 10:29:18 +0100
commit995d400ceca3e552f84fe19f150fb03327bdc0c2 (patch)
treeb6f6f325730be3374c7aad55f4ebb01244f17ba0 /doc/src
parent9bc1eee988c31e66a27e007d41020664df490214 (diff)
downloadpostgresql-995d400ceca3e552f84fe19f150fb03327bdc0c2.tar.gz
postgresql-995d400ceca3e552f84fe19f150fb03327bdc0c2.zip
Allow passing extra options to initdb for tests
Setting the environment variable PG_TEST_INITDB_EXTRA_OPTS passes extra options to initdb run by pg_regress or PostgreSQL::Test::Cluster's init. This can be useful for a wide variety of uses, like running all tests with checksums enabled, or with JIT enabled, or with different GUC settings, or with different locale settings. (Not all tests are going to pass with arbitrary options, but it is useful to run this against specific test suites.) Reviewed-by: Ian Lawrence Barwick <barwick@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/d4d2ad9f-1c1d-47a1-bb4d-c10a747d4f15%40eisentraut.org
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/regress.sgml34
1 files changed, 27 insertions, 7 deletions
diff --git a/doc/src/sgml/regress.sgml b/doc/src/sgml/regress.sgml
index 70d9bdefe1b..6a27aae3195 100644
--- a/doc/src/sgml/regress.sgml
+++ b/doc/src/sgml/regress.sgml
@@ -390,12 +390,37 @@ make check LANG=C ENCODING=EUC_JP
<title>Custom Server Settings</title>
<para>
- Custom server settings to use when running a regression test suite can be
+ There are several ways to use custom server settings when running a test
+ suite. This can be useful to enable additional logging, adjust resource
+ limits, or enable extra run-time checks such as <xref
+ linkend="guc-debug-discard-caches"/>. But note that not all tests can be
+ expected to pass cleanly with arbitrary settings.
+ </para>
+
+ <para>
+ Extra options can be passed to the various <command>initdb</command>
+ commands that are run internally during test setup using the environment
+ variable <envar>PG_TEST_INITDB_EXTRA_OPTS</envar>. For example, to run a
+ test with checksums enabled and a custom WAL segment size and
+ <varname>work_mem</varname> setting, use:
+<screen>
+make check PG_TEST_INITDB_EXTRA_OPTS='-k --wal-segsize=4 -c work_mem=50MB'
+</screen>
+ </para>
+
+ <para>
+ For the core regression test suite and other tests driven by
+ <command>pg_regress</command>, custom run-time server settings can also be
set in the <varname>PGOPTIONS</varname> environment variable (for settings
- that allow this):
+ that allow this), for example:
<screen>
make check PGOPTIONS="-c debug_parallel_query=regress -c work_mem=50MB"
</screen>
+ (This makes use of functionality provided by libpq; see <xref
+ linkend="libpq-connect-options"/> for details.)
+ </para>
+
+ <para>
When running against a temporary installation, custom settings can also be
set by supplying a pre-written <filename>postgresql.conf</filename>:
<screen>
@@ -405,11 +430,6 @@ make check EXTRA_REGRESS_OPTS="--temp-config=test_postgresql.conf"
</screen>
</para>
- <para>
- This can be useful to enable additional logging, adjust resource limits,
- or enable extra run-time checks such as <xref
- linkend="guc-debug-discard-caches"/>.
- </para>
</sect2>
<sect2 id="regress-run-extra-tests">