Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb3b4d8e

Browse files
committed
Move Perl test modules to a better namespace
The five modules in our TAP test framework all had names in the toplevel namespace. This is unwise because, even though we're notexporting them to CPAN, the names can leak, for example if they areexported by the RPM build process. We therefore move the modules to thePostgreSQL::Test namespace. In the process PostgresNode is renamed toCluster, and TestLib is renamed to Utils. PostgresVersion becomes simplyPostgreSQL::Version, to avoid possible confusion about what it's theversion of.Discussion:https://postgr.es/m/aede93a4-7d92-ef26-398f-5094944c2504@dunslane.netReviewed by Erik Rijkers and Michael Paquier
1 parent3cd9c3b commitb3b4d8e

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-
usePostgresNode;
8-
useTestLib;
7+
usePostgreSQL::Test::Cluster;
8+
usePostgreSQL::Test::Utils;
99

1010
use Fcntlqw(:seek);
1111
use Test::Moretests=> 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-
usePostgresNode;
10-
useTestLib;
9+
usePostgreSQL::Test::Cluster;
10+
usePostgreSQL::Test::Utils;
1111

1212
use Test::Moretests=> 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-
usePostgresNode;
10-
useTestLib;
9+
usePostgreSQL::Test::Cluster;
10+
usePostgreSQL::Test::Utils;
1111

1212
use Test::Moretests=> 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-
usePostgresNode;
8-
useTestLib;
7+
usePostgreSQL::Test::Cluster;
8+
usePostgreSQL::Test::Utils;
99
use Test::Moretests=> 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-
usePostgresNode;
8-
useTestLib;
7+
usePostgreSQL::Test::Cluster;
8+
usePostgreSQL::Test::Utils;
99
use Test::Moretests=> 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-
useTestLib;
7+
usePostgreSQL::Test::Utils;
88
use Test::Moretests=> 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::Pathqw(rmtree);
9-
usePostgresNode;
10-
useTestLib;
9+
usePostgreSQL::Test::Cluster;
10+
usePostgreSQL::Test::Utils;
1111
use Test::Moretests=> 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-
useTestLib;
7+
usePostgreSQL::Test::Utils;
88
use Test::Moretests=> 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::statqw{lstat};
12-
usePostgresNode;
13-
useTestLib;
12+
usePostgreSQL::Test::Cluster;
13+
usePostgreSQL::Test::Utils;
1414
use Test::Moretests=> 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-
useTestLib;
7+
usePostgreSQL::Test::Utils;
88
use Test::Moretests=> 8;
99

1010
program_help_ok('pg_amcheck');

‎src/bin/pg_amcheck/t/002_nonesuch.pl

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

7-
usePostgresNode;
8-
useTestLib;
7+
usePostgreSQL::Test::Cluster;
8+
usePostgreSQL::Test::Utils;
99
use Test::Moretests=> 76;
1010

1111
# Test set-up
1212
my ($node,$port);
13-
$node =PostgresNode->new('test');
13+
$node =PostgreSQL::Test::Cluster->new('test');
1414
$node->init;
1515
$node->start;
1616
$port =$node->port;

‎src/bin/pg_amcheck/t/003_check.pl

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

7-
usePostgresNode;
8-
useTestLib;
7+
usePostgreSQL::Test::Cluster;
8+
usePostgreSQL::Test::Utils;
99

1010
use Fcntlqw(:seek);
1111
use Test::Moretests=> 63;
@@ -120,7 +120,7 @@ ()
120120
}
121121

122122
# Test set-up
123-
$node =PostgresNode->new('test');
123+
$node =PostgreSQL::Test::Cluster->new('test');
124124
$node->init;
125125
$node->append_conf('postgresql.conf','autovacuum=off');
126126
$node->start;
@@ -316,7 +316,7 @@ ()
316316
# Leave 'db3' uncorrupted
317317
#
318318

319-
# Standard first arguments toTestLib functions
319+
# Standard first arguments toPostgreSQL::Test::Utils functions
320320
my@cmd = ('pg_amcheck','-p',$port);
321321

322322
# Regular expressions to match various expected output

‎src/bin/pg_amcheck/t/004_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-
usePostgresNode;
8-
useTestLib;
7+
usePostgreSQL::Test::Cluster;
8+
usePostgreSQL::Test::Utils;
99

1010
use Fcntlqw(:seek);
1111
use Test::More;
@@ -178,7 +178,7 @@ sub write_tuple
178178
# Set up the node. Once we create and corrupt the table,
179179
# autovacuum workers visiting the table could crash the backend.
180180
# Disable autovacuum so that won't happen.
181-
my$node =PostgresNode->new('test');
181+
my$node =PostgreSQL::Test::Cluster->new('test');
182182
$node->init;
183183
$node->append_conf('postgresql.conf','autovacuum=off');
184184

‎src/bin/pg_amcheck/t/005_opclass_damage.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
#
77
use strict;
88
use warnings;
9-
usePostgresNode;
10-
useTestLib;
9+
usePostgreSQL::Test::Cluster;
10+
usePostgreSQL::Test::Utils;
1111
use Test::Moretests=> 5;
1212

13-
my$node =PostgresNode->new('test');
13+
my$node =PostgreSQL::Test::Cluster->new('test');
1414
$node->init;
1515
$node->start;
1616

‎src/bin/pg_archivecleanup/t/010_pg_archivecleanup.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
use strict;
55
use warnings;
6-
useTestLib;
6+
usePostgreSQL::Test::Utils;
77
use Test::Moretests=> 42;
88

99
program_help_ok('pg_archivecleanup');
1010
program_version_ok('pg_archivecleanup');
1111
program_options_handling_ok('pg_archivecleanup');
1212

13-
my$tempdir =TestLib::tempdir;
13+
my$tempdir =PostgreSQL::Test::Utils::tempdir;
1414

1515
my@walfiles = (
1616
'00000001000000370000000C.gz','00000001000000370000000D',

‎src/bin/pg_basebackup/t/010_pg_basebackup.pl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
use File::Basenameqw(basename dirname);
99
use File::Pathqw(rmtree);
1010
use Fcntlqw(:seek);
11-
usePostgresNode;
12-
useTestLib;
11+
usePostgreSQL::Test::Cluster;
12+
usePostgreSQL::Test::Utils;
1313
use Test::Moretests=> 110;
1414

1515
program_help_ok('pg_basebackup');
1616
program_version_ok('pg_basebackup');
1717
program_options_handling_ok('pg_basebackup');
1818

19-
my$tempdir =TestLib::tempdir;
19+
my$tempdir =PostgreSQL::Test::Utils::tempdir;
2020

21-
my$node =PostgresNode->new('main');
21+
my$node =PostgreSQL::Test::Cluster->new('main');
2222

2323
# Set umask so test directories and files are created with default permissions
2424
umask(0077);
@@ -238,14 +238,14 @@
238238
# to our physical temp location. That way we can use shorter names
239239
# for the tablespace directories, which hopefully won't run afoul of
240240
# the 99 character length limit.
241-
my$sys_tempdir =TestLib::tempdir_short;
242-
my$real_sys_tempdir =TestLib::perl2host($sys_tempdir) ."/tempdir";
241+
my$sys_tempdir =PostgreSQL::Test::Utils::tempdir_short;
242+
my$real_sys_tempdir =PostgreSQL::Test::Utils::perl2host($sys_tempdir) ."/tempdir";
243243
my$shorter_tempdir =$sys_tempdir ."/tempdir";
244244
dir_symlink"$tempdir",$shorter_tempdir;
245245

246246
mkdir"$tempdir/tblspc1";
247247
my$realTsDir ="$real_sys_tempdir/tblspc1";
248-
my$real_tempdir =TestLib::perl2host($tempdir);
248+
my$real_tempdir =PostgreSQL::Test::Utils::perl2host($tempdir);
249249
$node->safe_psql('postgres',
250250
"CREATE TABLESPACE tblspc1 LOCATION '$realTsDir';");
251251
$node->safe_psql('postgres',
@@ -270,7 +270,7 @@
270270
skip"no tar program available", 1
271271
if (!defined$tar ||$tareq'');
272272

273-
my$node2 =PostgresNode->new('replica');
273+
my$node2 =PostgreSQL::Test::Cluster->new('replica');
274274

275275
# Recover main data directory
276276
$node2->init_from_backup($node,'tarbackup2',tar_program=>$tar);
@@ -279,7 +279,7 @@
279279
my$repTsDir ="$tempdir/tblspc1replica";
280280
my$realRepTsDir ="$real_sys_tempdir/tblspc1replica";
281281
mkdir$repTsDir;
282-
TestLib::system_or_bail($tar,'xf',$tblspc_tars[0],'-C',$repTsDir);
282+
PostgreSQL::Test::Utils::system_or_bail($tar,'xf',$tblspc_tars[0],'-C',$repTsDir);
283283

284284
# Update tablespace map to point to new directory.
285285
# XXX Ideally pg_basebackup would handle this.

‎src/bin/pg_basebackup/t/020_pg_receivewal.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
use strict;
55
use warnings;
6-
useTestLib;
7-
usePostgresNode;
6+
usePostgreSQL::Test::Utils;
7+
usePostgreSQL::Test::Cluster;
88
use Test::Moretests=> 27;
99

1010
program_help_ok('pg_receivewal');
@@ -14,7 +14,7 @@
1414
# Set umask so test directories and files are created with default permissions
1515
umask(0077);
1616

17-
my$primary =PostgresNode->new('primary');
17+
my$primary =PostgreSQL::Test::Cluster->new('primary');
1818
$primary->init(allows_streaming=> 1);
1919
$primary->start;
2020

‎src/bin/pg_basebackup/t/030_pg_recvlogical.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
use strict;
55
use warnings;
6-
useTestLib;
7-
usePostgresNode;
6+
usePostgreSQL::Test::Utils;
7+
usePostgreSQL::Test::Cluster;
88
use Test::Moretests=> 20;
99

1010
program_help_ok('pg_recvlogical');
1111
program_version_ok('pg_recvlogical');
1212
program_options_handling_ok('pg_recvlogical');
1313

14-
my$node =PostgresNode->new('main');
14+
my$node =PostgreSQL::Test::Cluster->new('main');
1515

1616
# Initialize node without replication settings
1717
$node->init(allows_streaming=> 1,has_archiving=> 1);

‎src/bin/pg_checksums/t/001_basic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use strict;
55
use warnings;
6-
useTestLib;
6+
usePostgreSQL::Test::Utils;
77
use Test::Moretests=> 8;
88

99
program_help_ok('pg_checksums');

‎src/bin/pg_checksums/t/002_actions.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
use strict;
88
use warnings;
99
use Config;
10-
usePostgresNode;
11-
useTestLib;
10+
usePostgreSQL::Test::Cluster;
11+
usePostgreSQL::Test::Utils;
1212

1313
use Fcntlqw(:seek);
1414
use Test::Moretests=> 66;
@@ -93,7 +93,7 @@ sub check_relation_corruption
9393
}
9494

9595
# Initialize node with checksums disabled.
96-
my$node =PostgresNode->new('node_checksum');
96+
my$node =PostgreSQL::Test::Cluster->new('node_checksum');
9797
$node->init();
9898
my$pgdata =$node->data_dir;
9999

@@ -207,7 +207,7 @@ sub check_relation_corruption
207207
my$basedir =$node->basedir;
208208
my$tablespace_dir ="$basedir/ts_corrupt_dir";
209209
mkdir($tablespace_dir);
210-
$tablespace_dir =TestLib::perl2host($tablespace_dir);
210+
$tablespace_dir =PostgreSQL::Test::Utils::perl2host($tablespace_dir);
211211
$node->safe_psql('postgres',
212212
"CREATE TABLESPACE ts_corrupt LOCATION '$tablespace_dir';");
213213
check_relation_corruption($node,'corrupt2','ts_corrupt');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp