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 1nqTJ5-0005Jq-8x for pgsql-hackers@arkaria.postgresql.org; Mon, 16 May 2022 05:30:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nqTJ3-0006Y2-Sb for pgsql-hackers@arkaria.postgresql.org; Mon, 16 May 2022 05:30:09 +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 1nqTJ3-0006Xt-FJ for pgsql-hackers@lists.postgresql.org; Mon, 16 May 2022 05:30:09 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqTJ1-00047T-53 for pgsql-hackers@lists.postgresql.org; Mon, 16 May 2022 05:30:08 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 38D485C01AE; Mon, 16 May 2022 01:30:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 16 May 2022 01:30:06 -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=1652679006; x=1652765406; bh=KXEBj53rJU 4DZAjNm6SQGJSbB1TrarIHsNt9gRgwiqA=; b=WnxxYz7mHy9hgey6ucWda5ZweI 041rvyD1ptBUWtToyPN9H+egswbf4NcCk1MD8xhwDGZr5Z/tVEC1pKfZFXoiKTg7 J8JPkhGk+ATAefdAZpZotplcBKfmWK6f15QvNGMG2VFqyMY4r/Dv9q/7Ma8d9ueO swX8JYvwlFexHKAjP1MjpKQ7nzRRNqEz11md1yQYJMopuXLBHRDSheLdNeSqLcI2 n6SNUASv5CUsykRHqFXnKJDvd1Iihcs+rhIBDZ63ShYQmNCtZjUtJEDMaYqzLnHo PqRWEu54ArWmXRGD4bJUvQIu9/cNssrdNixeCMrBdimMWTyF07IauCBcLY/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; 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:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1652679006; x= 1652765406; bh=KXEBj53rJU4DZAjNm6SQGJSbB1TrarIHsNt9gRgwiqA=; b=R nY2d2G+2I5VxevoJwXrXUkEHplwadkQpUu2XNT84c2KI42rMdej+xFxC/Hv+7uo3 Bs1dViMCZ9FozbPu/dTqLIH+oyPTdvZwwMTEkRK9NknPjntuu/XtQZukJ2jxbe1G 5pPb5RKcOnHDgh6EtF6JMfsNyPgabSNUepvLRuXQQ/4WN7cc9/jqdhAnssF5BqES xWxMTfFK6mqk4dj+M1obBtZAWRAfQbWFRsvj/k0fKilDEQqFfnqPMbVtgdZeJrZ3 G6WmHBUBMuOzixUuwtLdul08y2A0f+jOhu4GpTJo6efOY+26canpjrMDfQ5noIQF fK/jA8AMEBSENi/4IoIYA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrheeggdelkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 May 2022 01:30:03 -0400 (EDT) Date: Mon, 16 May 2022 14:30:00 +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: <20220331053616.u446wsr732quuzer@alap3.anarazel.de> <547429.1648734590@sss.pgh.pa.us> <20220502042718.GB1565149@rfd.leadboat.com> <20220511053255.GA2578591@rfd.leadboat.com> <20220514082728.GE2684227@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/jlwOBGEgC16HAIk" Content-Disposition: inline In-Reply-To: <20220514082728.GE2684227@rfd.leadboat.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --/jlwOBGEgC16HAIk Content-Type: multipart/mixed; boundary="1lenwIkZl3c6mcbU" Content-Disposition: inline --1lenwIkZl3c6mcbU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --1lenwIkZl3c6mcbU Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="upgrade-tap-fixes-noah-2.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..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) =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, "\\\"\\", 1, 45, "\\\\\"\\\\\\"); + generate_db($oldnode, '', 46, 90, ''); + generate_db($oldnode, '', 91, 127, ''); =20 # Grab any regression options that may be passed down by caller. my $extra_opts =3D $ENV{EXTRA_REGRESS_OPTS} || ""; --1lenwIkZl3c6mcbU-- --/jlwOBGEgC16HAIk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmKB4VgACgkQnvQgOdby QH2wTw/7Bvj8VE5EAZWU6QiKQT1PdC6RBNabcFgPlFwI9jgrk3TlibMVjjqHlzZ5 +xQNKlDQBY6hlgzlZGf+bh89o/yFhzfhNprM5ZC/nNn8o3PuJLGSYQMKiHFPO6kb Di2eLJUur/rzR7gq3Y6ee/oydn40B3e1gwuxZQrONU20Fq8WHUPvUyrkM30oW9Gj M9ioV8ZF6RjQWGWJ6+DJtXmfSmAMJfbVfcSPzcj3q4ZA49Z/xnogpxps3Al5c8pV iyzNdAjVdAU0DUEqUoojIWIUvHJTUfvGxvyWyCE928f8w/7Fv3vXkTr0ASLQypKW MiDaMPwxvYTiesNOLChjSJo3KvF4LiGwzky1GRqVP4w7Zfy2RxrMzti5kWdOw1vb 75jQUSQiqFB88jT/Ss7F9Ka6POgUDY+wFoy5yyculQLtWOlzMGe8oHGCPKs5qN+i LAO8Hu5Wk6J7nE257BgHMk/R8tk0HQuUSBEeBboybhQiqiTmWsFEvqn1hbT2AMPD IAHRd0bu6W9zhxrHJCSWo9L80cx3FDKE5vEIVeUaX2KisoPqWGVpec8BK7yFAMvY oOxnEYSIW3ghF6xNMia2gZ/JxCq1CuT4BSD6RgqLgEEktA6zOzkPIZN0m/MstsLf Oo21k43a+c//FiIUvlBdJs7y/1DaZH8zyRJh87I5ZOhqWqK8Lbc= =6G8y -----END PGP SIGNATURE----- --/jlwOBGEgC16HAIk--