pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix regression tests to use only global names beginning with "re
Date: Sat, 29 Jun 2019 15:34:10 +0000
Message-ID: <E1hhFMg-0006BF-JS@gemulon.postgresql.org> (raw)

Fix regression tests to use only global names beginning with "regress_".

In commit 18555b132 we tentatively established a rule that regression
tests should use names containing "regression" for databases, and names
starting with "regress_" for all other globally-visible object names, so
as to circumscribe the side-effects that "make installcheck" could have on
an existing installation.  However, no enforcement mechanism was created,
so it's unsurprising that some new violations have crept in since then.

In fact, a whole new *category* of violations has crept in, to wit we now
also have globally-visible subscription and replication origin names, and
"make installcheck" could very easily clobber user-created objects of
those types.  So it's past time to do something about this.

This commit sanitizes the tests enough that they will pass (i.e. not
generate any visible warnings) with the enforcement mechanism I'll add
in the next commit.  There are some TAP tests that still trigger the
warnings, but the warnings do not cause test failure.  Since these tests
do not actually run against a pre-existing installation, there's no need
to worry whether they could conflict with user-created objects.

The problem with rolenames.sql testing special role names like "user"
is still there, and is dealt with only very cosmetically in this patch
(by hiding the warnings :-().  What we actually need to do to be safe is
to take that test script out of "make installcheck" altogether, but that
seems like material for a separate patch.

Discussion: https://postgr.es/m/16638.1468620817@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ca129e58c01f29ef24a734313ff315933b3d5b67

Modified Files
--------------
contrib/test_decoding/expected/replorigin.out |  42 ++++----
contrib/test_decoding/expected/rewrite.out    |   6 +-
contrib/test_decoding/sql/replorigin.sql      |  26 ++---
contrib/test_decoding/sql/rewrite.sql         |   6 +-
src/bin/pg_dump/t/010_dump_connstr.pl         | 117 +++++++++++++--------
src/bin/pg_upgrade/test.sh                    |   6 +-
src/test/regress/expected/object_address.out  |   8 +-
src/test/regress/expected/rolenames.out       |   8 ++
src/test/regress/expected/subscription.out    | 142 +++++++++++++-------------
src/test/regress/sql/object_address.sql       |   6 +-
src/test/regress/sql/rolenames.sql            |  10 ++
src/test/regress/sql/subscription.sql         |  82 +++++++--------
12 files changed, 254 insertions(+), 205 deletions(-)



Message-ID: <E1hhFMg-0006BF-JS@gemulon.postgresql.org>
Permalink:  ../E1hhFMg-0006BF-JS@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hhFMg-0006BF-JS@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix regression tests to use only global names beginning with "re
  In-Reply-To: <E1hhFMg-0006BF-JS@gemulon.postgresql.org>
  References: <E1hhFMg-0006BF-JS@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox