Update regression testing instructions.
authorTom Lane
Fri, 14 Feb 2014 21:50:22 +0000 (16:50 -0500)
committerTom Lane
Fri, 14 Feb 2014 21:50:22 +0000 (16:50 -0500)
This documentation never got the word about the existence of check-world or
installcheck-world.  Revise to recommend use of those, and document all the
subsidiary test suites.  Do some minor wordsmithing elsewhere, too.

In passing, remove markup related to generation of plain-text regression
test instructions, since we don't do that anymore.

Back-patch to 9.1 where check-world was added.  (installcheck-world exists
in 9.0; but since check-world doesn't, this patch would need additional
work to cover that branch, and it doesn't seem worth the effort.)

doc/src/sgml/regress.sgml

index 2245b5c8e6239ba53c96261906c4d4a765538ad0..d8f0ace69e86fe5c4a47216f28907fb270c88bd3 100644 (file)
@@ -28,7 +28,7 @@
    sequential mode for running the tests.  The
    sequential method runs each test script alone, while the
    parallel method starts up multiple server processes to run groups
-   of tests in parallel.  Parallel testing gives confidence that
+   of tests in parallel.  Parallel testing adds confidence that
    interprocess communication and locking are working correctly.
   
 
@@ -43,9 +43,7 @@ make check
 
    in the top-level directory.  (Or you can change to
    src/test/regress and run the command there.)
-   This will first build several auxiliary files, such as
-   sample user-defined trigger functions, and then run the test driver
-   script.  At the end you should see something like:
+   At the end you should see something like:
 
 
 =======================
@@ -113,9 +111,9 @@ make MAX_CONNECTIONS=10 check
    Running the Tests Against an Existing Installation
 
   
-   To run the tests after installation)]]>,
+   To run the tests after installation (see ),
    initialize a data area and start the
-   server, ]]> then type:
+   server as explained in , then type:
 
 make installcheck
 
@@ -128,74 +126,86 @@ make installcheck-parallel
    PGPORT environment variables.  The tests will be run in a
    database named regression; any existing database by this name
    will be dropped.
-  
-
-  
-   The source distribution also contains regression tests for the optional
-   procedural languages and for some of the contrib modules.
-   At present, these tests can be used only against an already-installed
-   server.  To run the tests for all procedural languages that have been
-   built and installed, change to the src/pl directory of the
-   build tree and type:
-
-make installcheck
-
-   You can also do this in any of the subdirectories of src/pl
-   to run tests for just one procedural language.  To run the tests for all
-   contrib modules that have them, change to the
-   contrib directory of the build tree and type:
-
-make installcheck
-
-   The contrib modules must have been built and installed first.
-   You can also do this in a subdirectory of contrib to run
-   the tests for just one module.  Tests of contrib modules will
-   be run in a database named contrib_regression; any existing
-   database by this name will be dropped.
+   The tests will also transiently create some cluster-wide objects, such as
+   user identities named regressuserN.
   
   
 
   
-   <span class="marked">Testing Hot Standby</span>
+   <span class="marked">Additional Test Suites</span>
 
   
-   The source distribution also contains regression tests of the static
-   behavior of Hot Standby. These tests require a running primary server
-   and a running standby server that is accepting new WAL changes from the
-   primary using either file-based log shipping or streaming replication.
-   Those servers are not automatically created for you, nor is the setup
-   documented here. Please check the various sections of the documentation already
-   devoted to the required commands and related issues.
+   The make check and make installcheck commands
+   run only the core regression tests, which test built-in
+   functionality of the PostgreSQL server.  The source
+   distribution also contains additional test suites, most of them having
+   to do with add-on functionality such as optional procedural languages.
   
 
   
-   First create a database called "regression" on the primary.
+   To run all test suites applicable to the modules that have been selected
+   to be built, including the core tests, type one of these commands at the
+   top of the build tree:
 
-psql -h primary -c "CREATE DATABASE regression"
-
-   Next, run a preparatory script on the primary in the regression database:
-   src/test/regress/sql/hs_primary_setup.sql, and
-   allow for the changes to propagate to the standby, for example
-
-psql -h primary -f src/test/regress/sql/hs_primary_setup.sql regression
-
-   Now confirm that the default connection for the tester is the standby
-   server under test and then run the standbycheck target from the regression
-   directory:
-
-cd src/test/regress
-make standbycheck
+make check-world
+make installcheck-world
 
+   These commands run the tests using temporary servers or an
+   already-installed server, respectively, just as previously explained
+   for make check and make installcheck.  Other
+   considerations are the same as previously explained for each method.
+   Note that make check-world builds a separate temporary
+   installation tree for each tested module, so it requires a great deal
+   more time and disk space than make installcheck-world.
   
 
   
-   Some extreme behaviors can also be generated on the primary using the
-   script: src/test/regress/sql/hs_primary_extremes.sql
-   to allow the behavior of the standby to be tested.
+   Alternatively, you can run individual test suites by typing
+   make check or make installcheck in the appropriate
+   subdirectory of the build tree.  Keep in mind that make
+   installcheck assumes you've installed the relevant module(s), not
+   only the core server.
   
 
   
-   Additional automated testing may be available in later releases.
+   The additional tests that can be invoked this way include:
+  
+
+  
+   
+    
+     Regression tests for optional procedural languages (other than
+     PL/pgSQL, which is tested by the core tests).
+     These are located under src/pl.
+    
+   
+   
+    
+     Regression tests for contrib modules,
+     located under contrib.
+     Not all contrib modules have tests.
+    
+   
+   
+    
+     Regression tests for the ECPG interface library,
+     located in src/interfaces/ecpg/test.
+    
+   
+   
+    
+     Tests stressing behavior of concurrent sessions,
+     located in src/test/isolation.
+    
+   
+  
+
+  
+   When using installcheck mode, these tests will destroy any
+   existing databases named pl_regression,
+   contrib_regression, isolationtest,
+   regress1, or connectdb, as well as
+   regression.
   
   
 
@@ -203,7 +213,7 @@ make standbycheck
    Locale and Encoding
 
    
-    By default, the tests against a temporary installation use the
+    By default, tests using a temporary installation use the
     locale defined in the current environment and the corresponding
     database encoding as determined by initdb.  It
     can be useful to test different locales by setting the appropriate
@@ -236,8 +246,9 @@ make check LANG=C ENCODING=EUC_JP
    
 
    
-    The encoding can be set for tests against a temporary or an
-    existing installation.
+    The database encoding can be set for tests against either a temporary or
+    an existing installation, though in the latter case it must be
+    compatible with the installation's locale.
    
   
 
@@ -245,7 +256,7 @@ make check LANG=C ENCODING=EUC_JP
    Extra Tests
 
    
-    The regression test suite contains a few test files that are not
+    The core regression test suite contains a few test files that are not
     run by default, because they might be platform-dependent or take a
     very long time to run.  You can run these or other extra test
     files by setting the variable EXTRA_TESTS.  For
@@ -261,6 +272,52 @@ make check EXTRA_TESTS=collate.linux.utf8 LANG=en_US.utf8
     platforms, and only when run in a database that uses UTF-8 encoding.
    
   
+
+  
+   Testing Hot Standby
+
+  
+   The source distribution also contains regression tests for the static
+   behavior of Hot Standby. These tests require a running primary server
+   and a running standby server that is accepting new WAL changes from the
+   primary (using either file-based log shipping or streaming replication).
+   Those servers are not automatically created for you, nor is replication
+   setup documented here. Please check the various sections of the
+   documentation devoted to the required commands and related issues.
+  
+
+  
+   To run the Hot Standby tests, first create a database
+   called regression on the primary:
+
+psql -h primary -c "CREATE DATABASE regression"
+
+   Next, run the preparatory script
+   src/test/regress/sql/hs_primary_setup.sql
+   on the primary in the regression database, for example:
+
+psql -h primary -f src/test/regress/sql/hs_primary_setup.sql regression
+
+   Allow these changes to propagate to the standby.
+  
+
+  
+   Now arrange for the default database connection to be to the standby
+   server under test (for example, by setting the PGHOST and
+   PGPORT environment variables).
+   Finally, run make standbycheck in the regression directory:
+
+cd src/test/regress
+make standbycheck
+
+  
+
+  
+   Some extreme behaviors can also be generated on the primary using the
+   script src/test/regress/sql/hs_primary_extremes.sql
+   to allow the behavior of the standby to be tested.
+  
+  
   
 
   
@@ -289,7 +346,14 @@ make check EXTRA_TESTS=collate.linux.utf8 LANG=en_US.utf8
     file against the reference outputs stored in the
     src/test/regress/expected directory.  Any
     differences are saved for your inspection in
-    src/test/regress/regression.diffs.  If you don't
+    src/test/regress/regression.diffs.
+    (When running a test suite other than the core tests, these files
+    of course appear in the relevant subdirectory,
+    not src/test/regress.)
+   
+
+   
+    If you don't
     like the diff options that are used by default, set the
     environment variable PG_REGRESS_DIFF_OPTS, for
     instance PG_REGRESS_DIFF_OPTS='-u'.  (Or you
@@ -355,7 +419,7 @@ make check NO_LOCALE=1
     
 
     
-     In general, it is nevertheless advisable to try to run the
+     In general, it is advisable to try to run the
      regression tests in the locale setup that is wanted for
      production use, as this will exercise the locale- and
      encoding-related code portions that will actually be used in
@@ -389,7 +453,7 @@ make check NO_LOCALE=1
      results involving mathematical functions of double
      precision columns have been observed.  The float8 and
      geometry tests are particularly prone to small differences
-     across platforms, or even with different compiler optimization setting.
+     across platforms, or even with different compiler optimization settings.
      Human eyeball comparison is needed to determine the real
      significance of these differences which are usually 10 places to
      the right of the decimal point.
@@ -451,14 +515,19 @@ exclusion of those that don't.
      If the errors test results in a server crash
      at the select infinite_recurse() command, it means that
      the platform's limit on process stack size is smaller than the
-     ]]>
-     max_stack_depth]]>
-     parameter indicates.  This
+      parameter indicates.  This
      can be fixed by running the server under a higher stack
      size limit (4MB is recommended with the default value of
      max_stack_depth).  If you are unable to do that, an
      alternative is to reduce the value of max_stack_depth.
     
+
+    
+     On platforms supporting getrlimit(), the server should
+     automatically choose a safe value of max_stack_depth;
+     so unless you've manually overridden this setting, a failure of this
+     kind is a reportable bug.
+    
    
 
    
@@ -466,7 +535,7 @@ exclusion of those that don't.
 
     
      The random test script is intended to produce
-     random results.   In rare cases, this causes the random regression
+     random results.   In very rare cases, this causes that regression
      test to fail.  Typing:
 
 diff results/random.out expected/random.out
@@ -484,7 +553,7 @@ diff results/random.out expected/random.out
      parameter settings could cause the tests to fail.  For example, changing
      parameters such as enable_seqscan or
      enable_indexscan could cause plan changes that would
-     affect the results of tests which use EXPLAIN.
+     affect the results of tests that use EXPLAIN.