Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@gmail.com>, Noah Misch <noah@leadboat.com>, Julien Rouhaud <rjuju123@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Andrew Dunstan <andrew@dunslane.net>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-03-03T05:03:38Z
Lists: pgsql-hackers
Attachments
- v11-0001-Switch-tests-of-pg_upgrade-to-use-TAP.patch (text/x-diff) patch v11-0001
On Wed, Mar 02, 2022 at 12:07:29AM -0800, Andres Freund wrote:
>> +++ b/src/bin/pg_upgrade/t/001_basic.pl
>> @@ -0,0 +1,9 @@
>> +use strict;
>> +use warnings;
>> +
>> +use PostgreSQL::Test::Utils;
>> +use Test::More tests => 8;
>
> Outdated.
Fixed.
>> +program_help_ok('pg_upgrade');
>> +program_version_ok('pg_upgrade');
>> +program_options_handling_ok('pg_upgrade');
>
> Unrelated. But I kinda wish we'd do this in a saner manner than copying this
> test into every binary. E.g. by ensuring that all tools installed in the temp
> install are tested or such.
Perhaps. I am sticking with the existing style for now.
>> +# The test of pg_upgrade consists in setting up an instance. This is the
>> +# source instance used for the upgrade. Then a new and fresh instance is
>> +# created, and is used as the target instance for the upgrade.
>
> This seems a bit repetitive. Lots of "instance".
Indeed. I have reworked the whole, rather than just those three
sentences.
>> +if ( (defined($ENV{olddump}) && !defined($ENV{oldinstall}))
>> + || (!defined($ENV{olddump}) && defined($ENV{oldinstall})))
>
> Odd indentation. Spaces between parens?
Well, perltidy tells me that this is right.
>> +$newnode->init(extra => [ '--wal-segsize', '1', '--allow-group-access' ]);
>
> I'd copy the comments from test.sh wrt --wal-segsize,
> --allow-group-access.
Done.
--
Michael
Commits
-
Improve and fix some issues in the TAP tests of pg_upgrade
- eaa5ebe046c4 15.0 landed
-
Fix several issues with the TAP tests of pg_upgrade
- 7dd3ee508432 15.0 landed
-
Make upgradecheck a no-op in MSVC's vcregress.pl
- d2a2ce4184b0 15.0 landed
-
Switch the regression tests of pg_upgrade to use TAP tests
- 322becb6085c 15.0 landed
-
Fix check for PGHOST[ADDR] in pg_upgrade with Windows and temporary paths
- dc57366c5836 15.0 landed
-
Remove REGRESS_OUTPUTDIR environment variable.
- 7e6124ca7d81 15.0 landed
-
Add PostgreSQL::Test::Cluster::config_data()
- ba15f16107be 15.0 landed