Skip to content

Commit b3b4d8e

Browse files
committed
Move Perl test modules to a better namespace
The five modules in our TAP test framework all had names in the top level namespace. This is unwise because, even though we're not exporting them to CPAN, the names can leak, for example if they are exported by the RPM build process. We therefore move the modules to the PostgreSQL::Test namespace. In the process PostgresNode is renamed to Cluster, and TestLib is renamed to Utils. PostgresVersion becomes simply PostgreSQL::Version, to avoid possible confusion about what it's the version of. Discussion: https://postgr.es/m/aede93a4-7d92-ef26-398f-5094944c2504@dunslane.net Reviewed by Erik Rijkers and Michael Paquier
1 parent 3cd9c3b commit b3b4d8e

File tree

144 files changed

+656
-656
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+656
-656
lines changed

contrib/amcheck/t/001_verify_heapam.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
use strict;
55
use warnings;
66

7-
use PostgresNode;
8-
use TestLib;
7+
use PostgreSQL::Test::Cluster;
8+
use PostgreSQL::Test::Utils;
99

1010
use Fcntl qw(:seek);
1111
use Test::More tests => 272;
@@ -15,7 +15,7 @@
1515
#
1616
# Test set-up
1717
#
18-
$node = PostgresNode->new('test');
18+
$node = PostgreSQL::Test::Cluster->new('test');
1919
$node->init;
2020
$node->append_conf('postgresql.conf', 'autovacuum=off');
2121
$node->start;

contrib/amcheck/t/002_cic.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
use warnings;
77

88
use Config;
9-
use PostgresNode;
10-
use TestLib;
9+
use PostgreSQL::Test::Cluster;
10+
use PostgreSQL::Test::Utils;
1111

1212
use Test::More tests => 4;
1313

@@ -16,7 +16,7 @@
1616
#
1717
# Test set-up
1818
#
19-
$node = PostgresNode->new('CIC_test');
19+
$node = PostgreSQL::Test::Cluster->new('CIC_test');
2020
$node->init;
2121
$node->append_conf('postgresql.conf', 'lock_timeout = 180000');
2222
$node->start;

contrib/amcheck/t/003_cic_2pc.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
use warnings;
77

88
use Config;
9-
use PostgresNode;
10-
use TestLib;
9+
use PostgreSQL::Test::Cluster;
10+
use PostgreSQL::Test::Utils;
1111

1212
use Test::More tests => 6;
1313

@@ -16,7 +16,7 @@
1616
#
1717
# Test set-up
1818
#
19-
$node = PostgresNode->new('CIC_2PC_test');
19+
$node = PostgreSQL::Test::Cluster->new('CIC_2PC_test');
2020
$node->init;
2121
$node->append_conf('postgresql.conf', 'max_prepared_transactions = 10');
2222
$node->append_conf('postgresql.conf', 'lock_timeout = 180000');

contrib/auto_explain/t/001_auto_explain.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
use strict;
55
use warnings;
66

7-
use PostgresNode;
8-
use TestLib;
7+
use PostgreSQL::Test::Cluster;
8+
use PostgreSQL::Test::Utils;
99
use Test::More tests => 4;
1010

11-
my $node = PostgresNode->new('main');
11+
my $node = PostgreSQL::Test::Cluster->new('main');
1212
$node->init;
1313
$node->append_conf('postgresql.conf',
1414
"shared_preload_libraries = 'auto_explain'");

contrib/bloom/t/001_wal.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# Test generic xlog record work for bloom index replication.
55
use strict;
66
use warnings;
7-
use PostgresNode;
8-
use TestLib;
7+
use PostgreSQL::Test::Cluster;
8+
use PostgreSQL::Test::Utils;
99
use Test::More tests => 31;
1010

1111
my $node_primary;
@@ -41,7 +41,7 @@ sub test_index_replay
4141
}
4242

4343
# Initialize primary node
44-
$node_primary = PostgresNode->new('primary');
44+
$node_primary = PostgreSQL::Test::Cluster->new('primary');
4545
$node_primary->init(allows_streaming => 1);
4646
$node_primary->start;
4747
my $backup_name = 'my_backup';
@@ -50,7 +50,7 @@ sub test_index_replay
5050
$node_primary->backup($backup_name);
5151

5252
# Create streaming standby linking to primary
53-
$node_standby = PostgresNode->new('standby');
53+
$node_standby = PostgreSQL::Test::Cluster->new('standby');
5454
$node_standby->init_from_backup($node_primary, $backup_name,
5555
has_streaming => 1);
5656
$node_standby->start;

contrib/oid2name/t/001_basic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use strict;
55
use warnings;
66

7-
use TestLib;
7+
use PostgreSQL::Test::Utils;
88
use Test::More tests => 8;
99

1010
#########################################

contrib/test_decoding/t/001_repl_stats.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
use strict;
77
use warnings;
88
use File::Path qw(rmtree);
9-
use PostgresNode;
10-
use TestLib;
9+
use PostgreSQL::Test::Cluster;
10+
use PostgreSQL::Test::Utils;
1111
use Test::More tests => 2;
1212

1313
# Test set-up
14-
my $node = PostgresNode->new('test');
14+
my $node = PostgreSQL::Test::Cluster->new('test');
1515
$node->init(allows_streaming => 'logical');
1616
$node->append_conf('postgresql.conf', 'synchronous_commit = on');
1717
$node->start;

contrib/vacuumlo/t/001_basic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use strict;
55
use warnings;
66

7-
use TestLib;
7+
use PostgreSQL::Test::Utils;
88
use Test::More tests => 8;
99

1010
program_help_ok('vacuumlo');

src/bin/initdb/t/001_initdb.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
use warnings;
1010
use Fcntl ':mode';
1111
use File::stat qw{lstat};
12-
use PostgresNode;
13-
use TestLib;
12+
use PostgreSQL::Test::Cluster;
13+
use PostgreSQL::Test::Utils;
1414
use Test::More tests => 22;
1515

16-
my $tempdir = TestLib::tempdir;
16+
my $tempdir = PostgreSQL::Test::Utils::tempdir;
1717
my $xlogdir = "$tempdir/pgxlog";
1818
my $datadir = "$tempdir/data";
1919

src/bin/pg_amcheck/t/001_basic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use strict;
55
use warnings;
66

7-
use TestLib;
7+
use PostgreSQL::Test::Utils;
88
use Test::More tests => 8;
99

1010
program_help_ok('pg_amcheck');

0 commit comments

Comments
 (0)