Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrFqv-0002E2-1K for pgsql-hackers@arkaria.postgresql.org; Wed, 18 May 2022 09:20:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nrFqt-0000k5-M8 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 May 2022 09:20:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrFqs-0000jw-I1 for pgsql-hackers@lists.postgresql.org; Wed, 18 May 2022 09:20:19 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrFqp-0002y8-MG for pgsql-hackers@lists.postgresql.org; Wed, 18 May 2022 09:20:17 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 148D33200905; Wed, 18 May 2022 05:20:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 18 May 2022 05:20:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1652865613; x=1652952013; bh=usmIo3Axkb UOPhxFjJxvPy2bshrjV+61CoZgcWLmgZQ=; b=vSix5hyHFsQeuEoOCYiI00L8bK rC50rQZf5IJGpR1nJK5hrC2qXi+vlpx8uTpajh1CLHtefE8Q+f1jNZaNIyaSNaK6 nhtUH+EE21FzIfTblw3gCbPaXyY5ZLtcybJb9rriuIT4LwCJYm/3+ZEe4zpH6F45 kK+kU1KgxUXssDolzl3hGQyiy+hEuv4Rtw1C1Oml0sGDKyiFUs4GAmWymj1uNZHL ZdihGKKVpDqv/ArVNGUG6gfZHv7Il7YsfOPE92qAONxnKgh2mgzqKpqxe+Qrd6w7 O49BklqspHW2eTxul/lYBhU6mEY4iu1DGAluC++/k+v+cnu2590Awckuz+Zg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1652865613; x=1652952013; bh=usmIo3AxkbUOPhxFjJxvPy2bshrj V+61CoZgcWLmgZQ=; b=G4LrNTfAO73XTANp65lVPIutdJWXKswx31eb2/n3iL2g +dg3ay7fkBXZW2nyVzU2xKl/quZoUfzegysQY2w623qTKLmmqiAqvgK4aBYJUjH7 VQKu7oCQgeWosSS3lo6QVdWPQPVb2xXzNVzvGHnawzCABhYRzHsVMdlQICGRL8oD FMqoxGyuBTuev19CFfIgvOppA8bypJSRYt2y71LsQNzp9bXcegUsFUzUjyag5/RX x2/k6IoDDPstc8FI+bNMBxdk+lRCmmqmdLpOJu+EhPJaMXpUhnwoBfKQwvK0lvUF bx4ZGZN7Qcv4CDmzXwmLAtprcQu6y7akaeLIOFgk7Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrheelgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculddvfedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetudetueeuhedvfedvgfehkeeu fedvueffheelveekueettdffheetjeffgedtueenucffohhmrghinhepphhoshhtghhrvg hsqhhlrdhorhhgpdhpghhsqhhlrdgsuhhilhgupdhgihhthhhusgdrtghomhenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlse hprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 May 2022 05:20:11 -0400 (EDT) Date: Wed, 18 May 2022 18:20:08 +0900 From: Michael Paquier To: Noah Misch Cc: Tom Lane , Andres Freund , Thomas Munro , Julien Rouhaud , Andrew Dunstan , Postgres hackers Subject: Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set Message-ID: References: <547429.1648734590@sss.pgh.pa.us> <20220502042718.GB1565149@rfd.leadboat.com> <20220511053255.GA2578591@rfd.leadboat.com> <20220514082728.GE2684227@rfd.leadboat.com> <20220518080315.GC2820845@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jFqksGfWApGEBN0Y" Content-Disposition: inline In-Reply-To: <20220518080315.GC2820845@rfd.leadboat.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --jFqksGfWApGEBN0Y Content-Type: multipart/mixed; boundary="v6+IxbfNT0H0yAFK" Content-Disposition: inline --v6+IxbfNT0H0yAFK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 18, 2022 at 01:03:15AM -0700, Noah Misch wrote: > On Mon, May 16, 2022 at 02:30:00PM +0900, Michael Paquier wrote: >> 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. >>=20 >> 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. >=20 > I would have picked the test.sh names, both because test.sh was the senior > implementation and because doing so avoids warnings under > -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS. See the warnings here: > https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=3Dlongfin&d= t=3D2022-05-18%2000%3A59%3A35&stg=3Dpg_upgrade-check Yes, I saw that. This did not bother me much as the TAP tests run in isolation, but I am fine to stick to your option and silence these. > More-notable line from that same log: > sh: /Users/buildfarm/bf-data/HEAD/pgsql.build/src/bin/pg_upgrade/../../..= /src/test/regress/pg_regress--port=3D5678: No such file or directory So you are using EXTRA_REGRESS_OPTS, then, and a space is missing from the first argument of the command used to make that work properly. > Commit 7dd3ee5 adopted much of the 027_stream_regress.pl approach to runn= ing > pg_regress, but it didn't grab the "is($rc, 0, 'regression tests pass')" > needed to make defects like that report a failure. Okay, added this one. >> + generate_db($oldnode, "\\\"\\", 1, 45, "\\\\\"\\\\\\"); >> + generate_db($oldnode, '', 46, 90, ''); >> + generate_db($oldnode, '', 91, 127, ''); >=20 > Does this pass on Windows? I'm 65% confident that released IPC::Run can't > handle this input due to https://github.com/toddr/IPC-Run/issues/142. If= it's > passing for you on Windows, then disregard. Hmm. The CI has been passing for me with this name pattern in place, as of https://github.com/michaelpq/postgres/tree/upgrade_tap_fixes. Attached is an updated patch to address your concerns. -- Michael --v6+IxbfNT0H0yAFK Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="upgrade-tap-fixes-noah-3.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/bin/pg_upgrade/t/002_pg_upgrade.pl b/src/bin/pg_upgrade/t/= 002_pg_upgrade.pl index 8372a85e6e..86fe1b4d09 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) =3D @_; + my ($node, $prefix, $from_char, $to_char, $suffix) =3D @_; =20 - my $dbname =3D ''; + my $dbname =3D $prefix; for my $i ($from_char .. $to_char) { next if $i =3D=3D 7 || $i =3D=3D 10 || $i =3D=3D 13; # skip BEL, LF, = and CR $dbname =3D $dbname . sprintf('%c', $i); } =20 - # Exercise backslashes adjacent to double quotes, a Windows special - # case. - $dbname =3D '\\"\\' . $dbname . '\\\\"\\\\\\'; + $dbname .=3D $suffix; $node->command_ok([ 'createdb', $dbname ]); } =20 @@ -79,10 +77,12 @@ else { # Default is to use pg_regress to set up the old instance. =20 - # 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, 'regression\\"\\', 1, 45, '\\\\"\\\\\\'); + generate_db($oldnode, 'regression', 46, 90, ''); + generate_db($oldnode, 'regression', 91, 127, ''); =20 # Grab any regression options that may be passed down by caller. my $extra_opts =3D $ENV{EXTRA_REGRESS_OPTS} || ""; @@ -99,7 +99,7 @@ else =20 my $rc =3D system($ENV{PG_REGRESS} - . "$extra_opts " + . " $extra_opts " . "--dlpath=3D\"$dlpath\" " . "--bindir=3D " . "--host=3D" @@ -121,6 +121,7 @@ else print "=3D=3D=3D EOF =3D=3D=3D\n"; } } + is($rc, 0, 'regression tests pass'); } =20 # Before dumping, get rid of objects not existing or not supported in later --v6+IxbfNT0H0yAFK-- --jFqksGfWApGEBN0Y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmKEukgACgkQnvQgOdby QH0OJQ/+Izp5tD9U1WgSuAUYKpdT3/uQV5GDWQ4ljTiCzdnO/4grF5I9adjcMo4x dvt6XFjJoK4Pq/0O4N7c/VBPLcHEMBRKxBLOvdHCnULrz6Si8aAndNsxD0+nO0Lc Aq2N9iZcFdctYIg/GvWnS+5z+2tgd2S2IxyE/03sdQwGlMvVUJr0tLO6AM1feCz9 GhcsfCRggIn7712+kHgWMqbY66mKJyNHr9MtS7jjGUI3YgTyHKg2teBjEBjBHfG5 Ux8TU6x7QAmc1yP5aqPULtEHxZQhXF/VniGv6fyRphAtdFpvSDN2ywt79J0LfRbf /u9+BWkT+cfeFDQdXIEimrndW78AB7uu+JmElWJQifl8WS0WdC6tr+QLRc3Az4Ky MKBaD5N7n19hLg5k0lrApR7CTRhzd6LeRWPQONwXL1RRGi7rEOVjp3ImmsS7kRhN n6Xs/qmzXLv09Te8JMqdpblnFcbY1Xj/y7fTPzQeZcuvjF7lckva0nRglCCkVFlm ZV3M4KeZUO5Lzz2MiZRDQpHntFaV5b1+NeRmm87DSOPomcQwZPA8VuOGj2POhnQY zGcKkC2ITHEKNzd3jmUB6UjBSzsmSnrT8BtmN0q2suQDrPt5Z/4x9Hb8RWbdpqWh yzYPgICcpeb1U3uwCeTH4IgP0aFWNcHoalTAcQ6BvxWXAoxQH3I= =2UYA -----END PGP SIGNATURE----- --jFqksGfWApGEBN0Y--