Add missing test names in TAP tests of pg_upgrade
authorMichael Paquier <[email protected]>
Thu, 2 Jun 2022 00:21:32 +0000 (09:21 +0900)
committerMichael Paquier <[email protected]>
Thu, 2 Jun 2022 00:21:32 +0000 (09:21 +0900)
While on it, this removes the inclusion of getcwd() as The test code
does not rely on it.

Author: Peter Eisentraut
Discussion: https://postgr.es/m/f80ace33-11fb-1cd3-20f8-98f51d151088@enterprisedb.com

src/bin/pg_upgrade/t/002_pg_upgrade.pl

index 75ac768a96ea2a5b4f352f94fa275e6da3f33536..80437e93b71fb42cbb5a8bff05c5a95b00ac8bc4 100644 (file)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Cwd qw(abs_path getcwd);
+use Cwd qw(abs_path);
 use File::Basename qw(dirname);
 use File::Compare;
 
@@ -23,7 +23,9 @@ sub generate_db
    }
 
    $dbname .= $suffix;
-   $node->command_ok([ 'createdb', $dbname ]);
+   $node->command_ok(
+       [ 'createdb', $dbname ],
+       "created database with ASCII characters from $from_char to $to_char");
 }
 
 # The test of pg_upgrade requires two clusters, an old one and a new one
@@ -71,7 +73,8 @@ if (defined($ENV{olddump}))
 
    # Load the dump using the "postgres" database as "regression" does
    # not exist yet, and we are done here.
-   $oldnode->command_ok([ 'psql', '-X', '-f', $olddumpfile, 'postgres' ]);
+   $oldnode->command_ok([ 'psql', '-X', '-f', $olddumpfile, 'postgres' ],
+       'loaded old dump file');
 }
 else
 {
@@ -136,7 +139,8 @@ if (defined($ENV{oldinstall}))
            'psql', '-X',
            '-f', "$srcdir/src/bin/pg_upgrade/upgrade_adapt.sql",
            'regression'
-       ]);
+       ],
+       'ran adapt script');
 }
 
 # Initialize a new node for the upgrade.
@@ -233,7 +237,8 @@ $newnode->command_ok(
        'pg_dumpall', '--no-sync',
        '-d',         $newnode->connstr('postgres'),
        '-f',         "$tempdir/dump2.sql"
-   ]);
+   ],
+   'dump before running pg_upgrade');
 
 # Compare the two dumps, there should be no differences.
 my $compare_res = compare("$tempdir/dump1.sql", "$tempdir/dump2.sql");