PostgreSQL
Prev | Chapter 34. Regression Test | Next

# Regression Test Procedure

Commands were tested on RedHat Linux version 4.2 using the bash shell. Except where noted, they will probably work on most systems. Commands like `ps` and `tar` vary wildly on what options you should use on each platform. Use common sense before typing in these commands.

Postgres Regression Test

1. Prepare the files needed for the regression test with:

       	    cd /usr/src/pgsql/src/test/regress
       	    gmake clean
       	    gmake all

   You can skip "gmake clean" if this is the first time you are running the tests.

   This step compiles a C program with PostgreSQL extension functions into a shared library. Localized SQL scripts and output-comparison files are also created for the tests that need them. The localization replaces macros in the source files with absolute pathnames and user names.

2. If you intend to use the "sequential" test procedure, which tests an already-installed postmaster, be sure that the postmaster is running. If it isn't already running, start the postmaster in an available window by typing

       	    postmaster

   or start the postmaster daemon running in the background by typing

       	    cd
       	    nohup postmaster > regress.log 2>&1 &

   The latter is probably preferable, since the regression test log will be quite lengthy (60K or so, in Postgres 7.0) and you might want to review it for clues if things go wrong.

   > Note: Do not run `postmaster` from the root account.

3. Run the regression tests. For a sequential test, type

       	    cd /usr/src/pgsql/src/test/regress
       	    gmake runtest

   For a parallel test, type

       	    cd /usr/src/pgsql/src/test/regress
       	    gmake runcheck

   The sequential test just runs the test scripts using your already-running postmaster. The parallel test will perform a complete installation of Postgres into a temporary directory, start a private postmaster therein, and then run the test scripts. Finally it will kill the private postmaster (but the temporary directory isn't removed automatically).

4. You should get on the screen (and also written to file ./regress.out) a series of statements stating which tests passed and which tests failed. Please note that it can be normal for some of the tests to "fail" due to platform-specific variations. See the next section for details on determining whether a "failure" is significant.

   Some of the tests, notably "numeric", can take a while, especially on slower platforms. Have patience.

5. After running the tests and examining the results, type

       	    cd /usr/src/pgsql/src/test/regress
       	    gmake clean

   to recover the temporary disk space used by the tests. If you ran a sequential test, also type

       	    dropdb regression

Prev | Home | Next
Regression Test | Up | Regression Analysis