mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-20 05:17:00 +08:00
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
This commit is contained in:
@ -7,7 +7,7 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use PostgreSQL::Test::Utils;
|
||||
use Test::More tests => 2;
|
||||
use Test::More;
|
||||
use PostgreSQL::Test::Cluster;
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('foxtrot');
|
||||
@ -34,3 +34,5 @@ my $recovered_ts = $node->safe_psql('postgres',
|
||||
'select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname = \'t\''
|
||||
);
|
||||
is($recovered_ts, $ts, 'commit TS remains after crash recovery');
|
||||
|
||||
done_testing();
|
||||
|
||||
@ -7,7 +7,7 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use PostgreSQL::Test::Utils;
|
||||
use Test::More tests => 4;
|
||||
use Test::More;
|
||||
use PostgreSQL::Test::Cluster;
|
||||
|
||||
my $bkplabel = 'backup';
|
||||
@ -64,3 +64,5 @@ like(
|
||||
$standby_ts_stderr,
|
||||
qr/could not get commit timestamp data/,
|
||||
'expected error when primary turned feature off');
|
||||
|
||||
done_testing();
|
||||
|
||||
@ -7,7 +7,7 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use PostgreSQL::Test::Utils;
|
||||
use Test::More tests => 4;
|
||||
use Test::More;
|
||||
use PostgreSQL::Test::Cluster;
|
||||
|
||||
my $bkplabel = 'backup';
|
||||
@ -65,3 +65,5 @@ my $standby_ts = $standby->safe_psql('postgres',
|
||||
);
|
||||
isnt($standby_ts, '',
|
||||
"standby gives valid value ($standby_ts) after promotion");
|
||||
|
||||
done_testing();
|
||||
|
||||
@ -6,7 +6,7 @@ use strict;
|
||||
use warnings;
|
||||
use PostgreSQL::Test::Cluster;
|
||||
use PostgreSQL::Test::Utils;
|
||||
use Test::More tests => 16;
|
||||
use Test::More;
|
||||
|
||||
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
|
||||
$node_primary->init(allows_streaming => 1);
|
||||
@ -150,3 +150,5 @@ is($after_enable_disabled_ts, '',
|
||||
'timestamp of disabled tx null after re-enable');
|
||||
|
||||
$node_primary->stop;
|
||||
|
||||
done_testing();
|
||||
|
||||
Reference in New Issue
Block a user