pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Noah Misch <noah@leadboat.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Julien Rouhaud <rjuju123@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set
Date: Mon, 16 May 2022 14:30:00 +0900
Message-ID: <YoHhWD5vQzb2mmiF@paquier.xyz> (raw)
In-Reply-To: <20220514082728.GE2684227@rfd.leadboat.com>
References: <20220331053616.u446wsr732quuzer@alap3.anarazel.de>
	<YkVetIPIk1ScfC9Q@paquier.xyz>
	<547429.1648734590@sss.pgh.pa.us>
	<YkZSgJ8tGy2tAWwf@paquier.xyz>
	<20220502042718.GB1565149@rfd.leadboat.com>
	<YniID7Lm9bZUoQXl@paquier.xyz>
	<YnsRiDW5tY8z0oCf@paquier.xyz>
	<20220511053255.GA2578591@rfd.leadboat.com>
	<YnyawnlheodeuFfS@paquier.xyz>
	<20220514082728.GE2684227@rfd.leadboat.com>

On Sat, May 14, 2022 at 01:27:28AM -0700, Noah Misch wrote:
> Here, I requested the rationale for the differences you had just described.
> You made a choice to stop testing one list of database names and start testing
> a different list of database names.  Why?

Because the shape of the new names does not change the test coverage
("regression" prefix or the addition of the double quotes with
backslashes for all the database names), while keeping the code a bit
simpler.  If you think that the older names are more adapted, I have
no objections to use them, FWIW, which is something like the patch
attached would achieve.

This uses the same convention as vcregress.pl before 322becb, but not
the one of test.sh where "regression" was appended to the database
names.
--
Michael

Attachments:

upgrade-tap-fixes-noah-2.patch (text/x-diff, 1.5K) download diff --git a/src/bin/pg_upgrade/t/002_pg_upgrade.pl b/src/bin/pg_upgrade/t/002_pg_upgrade.pl index 8372a85e6e..33a75991d8 100644 --- a/src/bin/pg_upgrade/t/002_pg_upgrade.pl +++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl @@ -13,18 +13,16 @@ use Test::More; # Generate a database with a name made of a range of ASCII characters. sub generate_db { - my ($node, $from_char, $to_char) = @_; + my ($node, $prefix, $from_char, $to_char, $suffix) = @_; - my $dbname = ''; + my $dbname = $prefix; for my $i ($from_char .. $to_char) { next if $i == 7 || $i == 10 || $i == 13; # skip BEL, LF, and CR $dbname = $dbname . sprintf('%c', $i); } - # Exercise backslashes adjacent to double quotes, a Windows special - # case. - $dbname = '\\"\\' . $dbname . '\\\\"\\\\\\'; + $dbname .= $suffix; $node->command_ok([ 'createdb', $dbname ]); } @@ -79,10 +77,12 @@ else { # Default is to use pg_regress to set up the old instance. - # Create databases with names covering most ASCII bytes - generate_db($oldnode, 1, 45); - generate_db($oldnode, 46, 90); - generate_db($oldnode, 91, 127); + # Create databases with names covering most ASCII bytes. The + # first name exercises backslashes adjacent to double quotes, a + # Windows special case. + generate_db($oldnode, "\\\"\\", 1, 45, "\\\\\"\\\\\\"); + generate_db($oldnode, '', 46, 90, ''); + generate_db($oldnode, '', 91, 127, ''); # Grab any regression options that may be passed down by caller. my $extra_opts = $ENV{EXTRA_REGRESS_OPTS} || "";
signature.asc (application/pgp-signature, 832B) download

view thread (137+ messages)  latest in thread

Message-ID: <YoHhWD5vQzb2mmiF@paquier.xyz>
Permalink:  ../YoHhWD5vQzb2mmiF@paquier.xyz/
Also on:    postgresql.org/message-id/YoHhWD5vQzb2mmiF@paquier.xyz

 ·  · 

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-hackers@postgresql.org
  Cc: michael@paquier.xyz, noah@leadboat.com, tgl@sss.pgh.pa.us, andres@anarazel.de, thomas.munro@gmail.com, rjuju123@gmail.com, andrew@dunslane.net
  Subject: Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set
  In-Reply-To: <YoHhWD5vQzb2mmiF@paquier.xyz>
  References: <20220331053616.u446wsr732quuzer@alap3.anarazel.de> <YkVetIPIk1ScfC9Q@paquier.xyz> <547429.1648734590@sss.pgh.pa.us> <YkZSgJ8tGy2tAWwf@paquier.xyz> <20220502042718.GB1565149@rfd.leadboat.com> <YniID7Lm9bZUoQXl@paquier.xyz> <YnsRiDW5tY8z0oCf@paquier.xyz> <20220511053255.GA2578591@rfd.leadboat.com> <YnyawnlheodeuFfS@paquier.xyz> <20220514082728.GE2684227@rfd.leadboat.com> <YoHhWD5vQzb2mmiF@paquier.xyz>

* 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