]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/regress-tap.html
WIP: toc builder
[ai-pg] / full-docs / src / sgml / html / regress-tap.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>31.4. TAP Tests</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="regress-variant.html" title="31.3. Variant Comparison Files" /><link rel="next" href="regress-coverage.html" title="31.5. Test Coverage Examination" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">31.4. TAP Tests</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="regress-variant.html" title="31.3. Variant Comparison Files">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="regress.html" title="Chapter 31. Regression Tests">Up</a></td><th width="60%" align="center">Chapter 31. Regression Tests</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="regress-coverage.html" title="31.5. Test Coverage Examination">Next</a></td></tr></table><hr /></div><div class="sect1" id="REGRESS-TAP"><div class="titlepage"><div><div><h2 class="title" style="clear: both">31.4. TAP Tests <a href="#REGRESS-TAP" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="regress-tap.html#REGRESS-TAP-VARS">31.4.1. Environment Variables</a></span></dt></dl></div><p>
3     Various tests, particularly the client program tests
4     under <code class="filename">src/bin</code>, use the Perl TAP tools and are run
5     using the Perl testing program <code class="command">prove</code>.  You can pass
6     command-line options to <code class="command">prove</code> by setting
7     the <code class="command">make</code> variable <code class="varname">PROVE_FLAGS</code>, for example:
8 </p><pre class="programlisting">
9 make -C src/bin check PROVE_FLAGS='--timer'
10 </pre><p>
11     See the manual page of <code class="command">prove</code> for more information.
12    </p><p>
13     The <code class="command">make</code> variable <code class="varname">PROVE_TESTS</code>
14     can be used to define a whitespace-separated list of paths relative
15     to the <code class="filename">Makefile</code> invoking <code class="command">prove</code>
16     to run the specified subset of tests instead of the default
17     <code class="filename">t/*.pl</code>.  For example:
18 </p><pre class="programlisting">
19 make check PROVE_TESTS='t/001_test1.pl t/003_test3.pl'
20 </pre><p>
21    </p><p>
22     The TAP tests require the Perl module <code class="literal">IPC::Run</code>.
23     This module is available from
24     <a class="ulink" href="https://metacpan.org/dist/IPC-Run" target="_top">CPAN</a>
25     or an operating system package.
26     They also require <span class="productname">PostgreSQL</span> to be
27     configured with the option <code class="option">--enable-tap-tests</code>.
28    </p><p>
29     Generically speaking, the TAP tests will test the executables in a
30     previously-installed installation tree if you say <code class="literal">make
31     installcheck</code>, or will build a new local installation tree from
32     current sources if you say <code class="literal">make check</code>.  In either
33     case they will initialize a local instance (data directory) and
34     transiently run a server in it.  Some of these tests run more than one
35     server.  Thus, these tests can be fairly resource-intensive.
36    </p><p>
37     It's important to realize that the TAP tests will start test server(s)
38     even when you say <code class="literal">make installcheck</code>; this is unlike
39     the traditional non-TAP testing infrastructure, which expects to use an
40     already-running test server in that case.  Some PostgreSQL
41     subdirectories contain both traditional-style and TAP-style tests,
42     meaning that <code class="literal">make installcheck</code> will produce a mix of
43     results from temporary servers and the already-running test server.
44    </p><div class="sect2" id="REGRESS-TAP-VARS"><div class="titlepage"><div><div><h3 class="title">31.4.1. Environment Variables <a href="#REGRESS-TAP-VARS" class="id_link">#</a></h3></div></div></div><p>
45     Data directories are named according to the test filename, and will be
46     retained if a test fails.  If the environment variable
47     <code class="varname">PG_TEST_NOCLEAN</code> is set, data directories will be
48     retained regardless of test status.  For example, retaining the data
49     directory regardless of test results when running the
50     <span class="application">pg_dump</span> tests:
51 </p><pre class="programlisting">
52 PG_TEST_NOCLEAN=1 make -C src/bin/pg_dump check
53 </pre><p>
54     This environment variable also prevents the test's temporary directories
55     from being removed.
56    </p><p>
57     Many operations in the test suites use a 180-second timeout, which on slow
58     hosts may lead to load-induced timeouts.  Setting the environment variable
59     <code class="varname">PG_TEST_TIMEOUT_DEFAULT</code> to a higher number will change
60     the default to avoid this.
61    </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="regress-variant.html" title="31.3. Variant Comparison Files">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="regress.html" title="Chapter 31. Regression Tests">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="regress-coverage.html" title="31.5. Test Coverage Examination">Next</a></td></tr><tr><td width="40%" align="left" valign="top">31.3. Variant Comparison Files </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 31.5. Test Coverage Examination</td></tr></table></div></body></html>