postgresql/src/test
Tom Lane 3911fd55f5 Create common infrastructure for cross-version upgrade testing.
To test pg_upgrade across major PG versions, we have to be able to
modify or drop any old objects with no-longer-supported properties,
and we have to be able to deal with cosmetic changes in pg_dump output.
Up to now, the buildfarm and pg_upgrade's own test infrastructure had
separate implementations of the former, and we had nothing but very
ad-hoc rules for the latter (including an arbitrary threshold on how
many lines of unchecked diff were okay!).  This patch creates a Perl
module that can be shared by both those use-cases, and adds logic
that deals with pg_dump output diffs in a much more tightly defined
fashion.

This largely supersedes previous efforts in commits 0df9641d3,
9814ff550, and 62be9e4cd, which developed a SQL-script-based solution
for the task of dropping old objects.  There was nothing fundamentally
wrong with that work in itself, but it had no basis for solving the
output-formatting problem.  The most plausible way to deal with
formatting is to build a Perl module that can perform editing on the
dump files; and once we commit to that, it makes more sense for the
same module to also embed the knowledge of what has to be done for
dropping old objects.

Back-patch versions of the helper module as far as 9.2, to
support buildfarm animals that still test that far back.
It's also necessary to back-patch PostgreSQL/Version.pm,
because the new code depends on that.  I fixed up pg_upgrade's
002_pg_upgrade.pl in v15, but did not look into back-patching
it further than that.

Tom Lane and Andrew Dunstan

Discussion: https://postgr.es/m/891521.1673657296@sss.pgh.pa.us
2023-01-16 20:35:53 -05:00
..
examples Client-side fixes for delayed NOTIFY receipt. 2018-10-19 22:22:57 -04:00
isolation Remove memory leaks in isolationtester. 2021-06-27 12:45:04 -04:00
locale Add a temp-install prerequisite to "check"-like targets not having one. 2017-11-05 18:52:38 -08:00
mb Revert "Fix broken multibyte regression tests." 2016-01-26 08:29:15 +09:00
modules Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:26:15 +09:00
perl Create common infrastructure for cross-version upgrade testing. 2023-01-16 20:35:53 -05:00
recovery Fix typo 2021-11-08 08:54:06 -03:00
regress Update alternative expected output file. 2021-11-03 19:41:49 +02:00
ssl Fix searchpath and module location for pg_rewind and ssl TAP tests 2019-02-07 11:10:34 -05:00
thread Update copyright for 2016 2016-01-02 13:33:40 -05:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
README Minor tweaks for new src/test/recovery 2016-02-29 18:16:59 -03:00

README

PostgreSQL tests
================

This directory contains a variety of test infrastructure as well as some of the
tests in PostgreSQL. Not all tests are here -- in particular, there are more in
individual contrib/ modules and in src/bin.

Not all these tests get run by "make check". Check src/test/Makefile to see
which tests get run automatically.

examples/
  Demonstration programs for libpq that double as regression tests via
  "make check"

isolation/
  Tests for concurrent behavior at the SQL level

locale/
  Sanity checks for locale data, encodings, etc

mb/
  Tests for multibyte encoding (UTF-8) support

modules/
  Extensions used only or mainly for test purposes, generally not suitable
  for installing in production databases

perl/
  Infrastructure for Perl-based TAP tests

recovery/
  Test suite for recovery and replication

regress/
  PostgreSQL's main regression test suite, pg_regress

ssl/
  Tests to exercise and verify SSL certificate handling

thread/
  A thread-safety-testing utility used by configure