]> begriffs open source - ai-pg/blob - full-docs/txt/regress-tap.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / regress-tap.txt
1
2 31.4. TAP Tests #
3
4    31.4.1. Environment Variables
5
6    Various tests, particularly the client program tests under src/bin, use
7    the Perl TAP tools and are run using the Perl testing program prove.
8    You can pass command-line options to prove by setting the make variable
9    PROVE_FLAGS, for example:
10 make -C src/bin check PROVE_FLAGS='--timer'
11
12    See the manual page of prove for more information.
13
14    The make variable PROVE_TESTS can be used to define a
15    whitespace-separated list of paths relative to the Makefile invoking
16    prove to run the specified subset of tests instead of the default
17    t/*.pl. For example:
18 make check PROVE_TESTS='t/001_test1.pl t/003_test3.pl'
19
20    The TAP tests require the Perl module IPC::Run. This module is
21    available from CPAN or an operating system package. They also require
22    PostgreSQL to be configured with the option --enable-tap-tests.
23
24    Generically speaking, the TAP tests will test the executables in a
25    previously-installed installation tree if you say make installcheck, or
26    will build a new local installation tree from current sources if you
27    say make check. In either case they will initialize a local instance
28    (data directory) and transiently run a server in it. Some of these
29    tests run more than one server. Thus, these tests can be fairly
30    resource-intensive.
31
32    It's important to realize that the TAP tests will start test server(s)
33    even when you say make installcheck; this is unlike the traditional
34    non-TAP testing infrastructure, which expects to use an already-running
35    test server in that case. Some PostgreSQL subdirectories contain both
36    traditional-style and TAP-style tests, meaning that make installcheck
37    will produce a mix of results from temporary servers and the
38    already-running test server.
39
40 31.4.1. Environment Variables #
41
42    Data directories are named according to the test filename, and will be
43    retained if a test fails. If the environment variable PG_TEST_NOCLEAN
44    is set, data directories will be retained regardless of test status.
45    For example, retaining the data directory regardless of test results
46    when running the pg_dump tests:
47 PG_TEST_NOCLEAN=1 make -C src/bin/pg_dump check
48
49    This environment variable also prevents the test's temporary
50    directories from being removed.
51
52    Many operations in the test suites use a 180-second timeout, which on
53    slow hosts may lead to load-induced timeouts. Setting the environment
54    variable PG_TEST_TIMEOUT_DEFAULT to a higher number will change the
55    default to avoid this.