Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b214155

Browse files
committed
Doc: improve README files associated with TAP tests.
Rearrange src/test/perl/README so that the first section is more clearly "how to run these tests", and the rest "how to write new tests". Add some basic info there about debugging test failures. Then, add cross-refs to that READNE from other READMEs that describe how to run TAP tests. Per suggestion from Kevin Burke, though this is not his original patch. Discussion: https://postgr.es/m/CAKcy5eiSbwiQnmCfnOnDCVC7B8fYyev3E=6pvvECP9pLE-Fcuw@mail.gmail.com
1 parent 6301c3a commit b214155

File tree

8 files changed

+35
-12
lines changed

8 files changed

+35
-12
lines changed

src/bin/pg_amcheck/README

+2
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ You can use "make installcheck" if you previously did "make install".
1717
In that case, the code in the installation tree is tested. With
1818
"make check", a temporary installation tree is built from the current
1919
sources and then tested.
20+
21+
See src/test/perl/README for more info about running these tests.

src/test/authentication/README

+2
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ sources and then tested.
2424

2525
Either way, this test initializes, starts, and stops a test Postgres
2626
cluster.
27+
28+
See src/test/perl/README for more info about running these tests.

src/test/kerberos/README

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ sources and then tested.
3232
Either way, this test initializes, starts, and stops a test Postgres
3333
cluster, as well as a test KDC server.
3434

35+
See src/test/perl/README for more info about running these tests.
36+
3537
Requirements
3638
============
3739

src/test/ldap/README

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ sources and then tested.
3131
Either way, this test initializes, starts, and stops a test Postgres
3232
cluster, as well as a test LDAP server.
3333

34+
See src/test/perl/README for more info about running these tests.
35+
3436
Requirements
3537
============
3638

src/test/perl/README

+15-8
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,29 @@ $(prove_installcheck) targets in Makefile.global. By default every test in the
1212
t/ subdirectory is run. Individual test(s) can be run instead by passing
1313
something like PROVE_TESTS="t/001_testname.pl t/002_othertestname.pl" to make.
1414

15-
You should prefer to write tests using pg_regress in src/test/regress, or
16-
isolation tester specs in src/test/isolation, if possible. If not, check to
17-
see if your new tests make sense under an existing tree in src/test, like
18-
src/test/ssl, or should be added to one of the suites for an existing utility.
19-
20-
Note that all tests and test tools should have perltidy run on them before
21-
patches are submitted, using perltidy --profile=src/tools/pgindent/perltidyrc
22-
2315
By default, to keep the noise low during runs, we do not set any flags via
2416
PROVE_FLAGS, but this can be done on the 'make' command line if desired, eg:
2517

2618
make check-world PROVE_FLAGS='--verbose'
2719

20+
When a test fails, the terminal output from 'prove' is usually not sufficient
21+
to diagnose the problem. Look into the log files that are left under
22+
tmp_check/log/ to get more info. Files named 'regress_log_XXX' are log
23+
output from the perl test scripts themselves, and should be examined first.
24+
Other files are postmaster logs, and may be helpful as additional data.
25+
26+
2827
Writing tests
2928
-------------
3029

30+
You should prefer to write tests using pg_regress in src/test/regress, or
31+
isolation tester specs in src/test/isolation, if possible. If not, check to
32+
see if your new tests make sense under an existing tree in src/test, like
33+
src/test/ssl, or should be added to one of the suites for an existing utility.
34+
35+
Note that all tests and test tools should have perltidy run on them before
36+
patches are submitted, using perltidy --profile=src/tools/pgindent/perltidyrc
37+
3138
Tests are written using Perl's Test::More with some PostgreSQL-specific
3239
infrastructure from src/test/perl providing node management, support for
3340
invoking 'psql' to run queries and get results, etc. You should read the

src/test/recovery/README

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ sources and then tested.
2323

2424
Either way, this test initializes, starts, and stops several test Postgres
2525
clusters.
26+
27+
See src/test/perl/README for more info about running these tests.

src/test/ssl/README

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ sources and then tested.
2929
Either way, this test initializes, starts, and stops a test Postgres
3030
cluster that is accessible to other local users!
3131

32+
See src/test/perl/README for more info about running these tests.
33+
3234
Certificates
3335
============
3436

src/test/subscription/README

+8-4
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ Running the tests
99
=================
1010

1111
NOTE: You must have given the --enable-tap-tests argument to configure.
12+
Also, to use "make installcheck", you must have built and installed
13+
contrib/hstore in addition to the core code.
1214

1315
Run
1416
make check
1517
or
1618
make installcheck
17-
You can use "make installcheck" if you previously did "make install"
18-
(including installing the hstore extension). In that case, the code
19-
in the installation tree is tested. With "make check", a temporary
20-
installation tree is built from the current sources and then tested.
19+
You can use "make installcheck" if you previously did "make install".
20+
In that case, the code in the installation tree is tested. With
21+
"make check", a temporary installation tree is built from the current
22+
sources and then tested.
2123

2224
Either way, this test initializes, starts, and stops several test Postgres
2325
clusters.
26+
27+
See src/test/perl/README for more info about running these tests.

0 commit comments

Comments
 (0)