diff options
author | Michael Paquier <michael@paquier.xyz> | 2025-03-17 12:42:23 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2025-03-17 12:42:23 +0900 |
commit | 19c6e92b13b2336d1db1b236457ab15d0894b506 (patch) | |
tree | 672b72d1e75f47fbbe28db3326267804c6af6dcf /src/bin/pg_rewind/t | |
parent | 5721e5453ebc59360b6756fe72d7499c4a02177c (diff) | |
download | postgresql-19c6e92b13b2336d1db1b236457ab15d0894b506.tar.gz postgresql-19c6e92b13b2336d1db1b236457ab15d0894b506.zip |
Apply more consistent style for command options in TAP tests
This commit reshapes the grammar of some commands to apply a more
consistent style across the board, following rules similar to
ce1b0f9da03e:
- Elimination of some pointless used-once variables.
- Use of long options, to self-document better the options used.
- Use of fat commas to link option names and their assigned values,
including redirections, so as perltidy can be tricked to put them
together.
Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Discussion: https://postgr.es/m/87jz8rzf3h.fsf@wibble.ilmari.org
Diffstat (limited to 'src/bin/pg_rewind/t')
-rw-r--r-- | src/bin/pg_rewind/t/009_growing_files.pl | 3 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/RewindTest.pm | 21 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/bin/pg_rewind/t/009_growing_files.pl b/src/bin/pg_rewind/t/009_growing_files.pl index 643d200dcc9..afe68c8bf0d 100644 --- a/src/bin/pg_rewind/t/009_growing_files.pl +++ b/src/bin/pg_rewind/t/009_growing_files.pl @@ -56,8 +56,7 @@ my $ret = run_log( '--target-pgdata' => $primary_pgdata, '--no-sync', ], - '2>>', - "$standby_pgdata/tst_both_dir/file1"); + '2>>' => "$standby_pgdata/tst_both_dir/file1"); ok(!$ret, 'Error out on copying growing file'); # Ensure that the files are of different size, the final error message should diff --git a/src/bin/pg_rewind/t/RewindTest.pm b/src/bin/pg_rewind/t/RewindTest.pm index ec3b4a51995..3efab831797 100644 --- a/src/bin/pg_rewind/t/RewindTest.pm +++ b/src/bin/pg_rewind/t/RewindTest.pm @@ -69,8 +69,9 @@ sub primary_psql my $cmd = shift; my $dbname = shift || 'postgres'; - system_or_bail 'psql', '-q', '--no-psqlrc', '-d', - $node_primary->connstr($dbname), '-c', "$cmd"; + system_or_bail 'psql', '--quiet', '--no-psqlrc', + '--dbname' => $node_primary->connstr($dbname), + '--command' => $cmd; return; } @@ -79,8 +80,9 @@ sub standby_psql my $cmd = shift; my $dbname = shift || 'postgres'; - system_or_bail 'psql', '-q', '--no-psqlrc', '-d', - $node_standby->connstr($dbname), '-c', "$cmd"; + system_or_bail 'psql', '--quiet', '--no-psqlrc', + '--dbname' => $node_standby->connstr($dbname), + '--command' => $cmd; return; } @@ -95,11 +97,12 @@ sub check_query # we want just the output, no formatting my $result = run [ - 'psql', '-q', '-A', '-t', '--no-psqlrc', '-d', - $node_primary->connstr('postgres'), - '-c', $query + 'psql', '--quiet', '--no-align', '--tuples-only', '--no-psqlrc', + '--dbname' => $node_primary->connstr('postgres'), + '--command' => $query ], - '>', \$stdout, '2>', \$stderr; + '>' => \$stdout, + '2>' => \$stderr; is($result, 1, "$test_name: psql exit code"); is($stderr, '', "$test_name: psql no stderr"); @@ -124,7 +127,7 @@ sub setup_cluster $node_primary->init( allows_streaming => 1, extra => $extra, - auth_extra => [ '--create-role', 'rewind_user' ]); + auth_extra => [ '--create-role' => 'rewind_user' ]); # Set wal_keep_size to prevent WAL segment recycling after enforced # checkpoints in the tests. |