diff options
author | Daniel Gustafsson <dgustafsson@postgresql.org> | 2022-02-11 20:54:44 +0100 |
---|---|---|
committer | Daniel Gustafsson <dgustafsson@postgresql.org> | 2022-02-11 20:54:44 +0100 |
commit | 549ec201d6132b7c7ee11ee90a4e02119259ba5b (patch) | |
tree | 44c1669ef24c66233c16b2fa77aff148596f67a7 /src/bin/pg_rewind/t | |
parent | 751b8d23b788580bbff7463e3959f9a92a95b28a (diff) | |
download | postgresql-549ec201d6132b7c7ee11ee90a4e02119259ba5b.tar.gz postgresql-549ec201d6132b7c7ee11ee90a4e02119259ba5b.zip |
Replace Test::More plans with done_testing
Rather than doing manual book keeping to plan the number of tests to run
in each TAP suite, conclude each run with done_testing() summing up the
the number of tests that ran. This removes the need for maintaning and
updating the plan count at the expense of an accurate count of remaining
during the test suite runtime.
This patch has been discussed a number of times, often in the context of
other patches which updates tests, so a larger number of discussions can
be found in the archives.
Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/DD399313-3D56-4666-8079-88949DAC870F@yesql.se
Diffstat (limited to 'src/bin/pg_rewind/t')
-rw-r--r-- | src/bin/pg_rewind/t/001_basic.pl | 4 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/002_databases.pl | 4 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/003_extrafiles.pl | 4 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/004_pg_xlog_symlink.pl | 4 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/005_same_timeline.pl | 5 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/006_options.pl | 4 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/007_standby_source.pl | 4 | ||||
-rw-r--r-- | src/bin/pg_rewind/t/008_min_recovery_point.pl | 4 |
8 files changed, 19 insertions, 14 deletions
diff --git a/src/bin/pg_rewind/t/001_basic.pl b/src/bin/pg_rewind/t/001_basic.pl index a20ebda3455..db9201f38e8 100644 --- a/src/bin/pg_rewind/t/001_basic.pl +++ b/src/bin/pg_rewind/t/001_basic.pl @@ -4,7 +4,7 @@ use strict; use warnings; use PostgreSQL::Test::Utils; -use Test::More tests => 23; +use Test::More; use FindBin; use lib $FindBin::RealBin; @@ -191,4 +191,4 @@ run_test('local'); run_test('remote'); run_test('archive'); -exit(0); +done_testing(); diff --git a/src/bin/pg_rewind/t/002_databases.pl b/src/bin/pg_rewind/t/002_databases.pl index 5fac050e4b1..8d6c0c0b280 100644 --- a/src/bin/pg_rewind/t/002_databases.pl +++ b/src/bin/pg_rewind/t/002_databases.pl @@ -4,7 +4,7 @@ use strict; use warnings; use PostgreSQL::Test::Utils; -use Test::More tests => 7; +use Test::More; use FindBin; use lib $FindBin::RealBin; @@ -74,4 +74,4 @@ template1 run_test('local'); run_test('remote'); -exit(0); +done_testing(); diff --git a/src/bin/pg_rewind/t/003_extrafiles.pl b/src/bin/pg_rewind/t/003_extrafiles.pl index 0d140342f23..b1c47ea4514 100644 --- a/src/bin/pg_rewind/t/003_extrafiles.pl +++ b/src/bin/pg_rewind/t/003_extrafiles.pl @@ -6,7 +6,7 @@ use strict; use warnings; use PostgreSQL::Test::Utils; -use Test::More tests => 5; +use Test::More; use File::Find; @@ -103,4 +103,4 @@ sub run_test run_test('local'); run_test('remote'); -exit(0); +done_testing(); diff --git a/src/bin/pg_rewind/t/004_pg_xlog_symlink.pl b/src/bin/pg_rewind/t/004_pg_xlog_symlink.pl index 9754fa7665f..805935c6fd5 100644 --- a/src/bin/pg_rewind/t/004_pg_xlog_symlink.pl +++ b/src/bin/pg_rewind/t/004_pg_xlog_symlink.pl @@ -9,7 +9,7 @@ use warnings; use File::Copy; use File::Path qw(rmtree); use PostgreSQL::Test::Utils; -use Test::More tests => 5; +use Test::More; use FindBin; use lib $FindBin::RealBin; @@ -76,4 +76,4 @@ in standby, after promotion run_test('local'); run_test('remote'); -exit(0); +done_testing(); diff --git a/src/bin/pg_rewind/t/005_same_timeline.pl b/src/bin/pg_rewind/t/005_same_timeline.pl index 2249694d9a6..ffb62f9b05a 100644 --- a/src/bin/pg_rewind/t/005_same_timeline.pl +++ b/src/bin/pg_rewind/t/005_same_timeline.pl @@ -8,7 +8,7 @@ use strict; use warnings; use PostgreSQL::Test::Utils; -use Test::More tests => 1; +use Test::More; use FindBin; use lib $FindBin::RealBin; @@ -20,4 +20,5 @@ RewindTest::start_primary(); RewindTest::create_standby(); RewindTest::run_pg_rewind('local'); RewindTest::clean_rewind_test(); -exit(0); + +done_testing(); diff --git a/src/bin/pg_rewind/t/006_options.pl b/src/bin/pg_rewind/t/006_options.pl index b5f502350f7..c3c27e9894c 100644 --- a/src/bin/pg_rewind/t/006_options.pl +++ b/src/bin/pg_rewind/t/006_options.pl @@ -7,7 +7,7 @@ use strict; use warnings; use PostgreSQL::Test::Utils; -use Test::More tests => 12; +use Test::More; program_help_ok('pg_rewind'); program_version_ok('pg_rewind'); @@ -41,3 +41,5 @@ command_fails( '--write-recovery-conf' ], 'no local source with --write-recovery-conf'); + +done_testing(); diff --git a/src/bin/pg_rewind/t/007_standby_source.pl b/src/bin/pg_rewind/t/007_standby_source.pl index df2e72912b4..47320ea5a67 100644 --- a/src/bin/pg_rewind/t/007_standby_source.pl +++ b/src/bin/pg_rewind/t/007_standby_source.pl @@ -27,7 +27,7 @@ use strict; use warnings; use PostgreSQL::Test::Utils; -use Test::More tests => 3; +use Test::More; use FindBin; use lib $FindBin::RealBin; @@ -176,4 +176,4 @@ $node_a->teardown_node; $node_b->teardown_node; $node_c->teardown_node; -exit(0); +done_testing(); diff --git a/src/bin/pg_rewind/t/008_min_recovery_point.pl b/src/bin/pg_rewind/t/008_min_recovery_point.pl index 8240229230d..e6a7177fb7d 100644 --- a/src/bin/pg_rewind/t/008_min_recovery_point.pl +++ b/src/bin/pg_rewind/t/008_min_recovery_point.pl @@ -34,7 +34,7 @@ use strict; use warnings; use PostgreSQL::Test::Cluster; use PostgreSQL::Test::Utils; -use Test::More tests => 3; +use Test::More; use File::Copy; @@ -173,3 +173,5 @@ and this too), 'table foo after rewind'); $result = $node_2->safe_psql('postgres', 'SELECT * FROM public.bar'); is($result, qq(in both), 'table bar after rewind'); + +done_testing(); |