Skip to content

Commit 1e9e355

Browse files
committed
Updated TAP tests to use PostgreSQL::Test packages [skip ci]
1 parent f1d283f commit 1e9e355

Some content is hidden

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

43 files changed

+133
-128
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ifeq ($(PROVE),)
5252
PROVE = prove
5353
endif
5454

55-
# for Postgres 15+
55+
# for Postgres < 15
5656
PROVE_FLAGS += -I ./test/perl
5757

5858
prove_installcheck:

test/perl/PostgreSQL/Test/Cluster.pm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package PostgreSQL::Test::Cluster;
2+
3+
use PostgresNode;
4+
5+
sub new
6+
{
7+
my ($class, $name) = @_;
8+
return get_new_node($name);
9+
}
10+
11+
1;

test/perl/PostgreSQL/Test/Utils.pm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package PostgreSQL::Test::Utils;
2+
3+
use TestLib;
4+
5+
1;

test/perl/PostgresNode.pm

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/perl/TestLib.pm

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/t/001_ivfflat_wal.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Test generic xlog record work for ivfflat index replication.
44
use strict;
55
use warnings;
6-
use PostgresNode;
7-
use TestLib;
6+
use PostgreSQL::Test::Cluster;
7+
use PostgreSQL::Test::Utils;
88
use Test::More;
99

1010
my $dim = 32;
@@ -49,7 +49,7 @@ sub test_index_replay
4949
my $array_sql = join(",", ('random()') x $dim);
5050

5151
# Initialize primary node
52-
$node_primary = get_new_node('primary');
52+
$node_primary = PostgreSQL::Test::Cluster->new('primary');
5353
$node_primary->init(allows_streaming => 1);
5454
if ($dim > 32)
5555
{
@@ -67,7 +67,7 @@ sub test_index_replay
6767
$node_primary->backup($backup_name);
6868

6969
# Create streaming replica linking to primary
70-
$node_replica = get_new_node('replica');
70+
$node_replica = PostgreSQL::Test::Cluster->new('replica');
7171
$node_replica->init_from_backup($node_primary, $backup_name, has_streaming => 1);
7272
$node_replica->start;
7373

test/t/002_ivfflat_vacuum.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use strict;
22
use warnings;
3-
use PostgresNode;
4-
use TestLib;
3+
use PostgreSQL::Test::Cluster;
4+
use PostgreSQL::Test::Utils;
55
use Test::More;
66

77
my $dim = 3;
@@ -15,7 +15,7 @@
1515
my $array_sql = join(", ", @r);
1616

1717
# Initialize node
18-
my $node = get_new_node('node');
18+
my $node = PostgreSQL::Test::Cluster->new('node');
1919
$node->init;
2020
$node->start;
2121

test/t/003_ivfflat_vector_build_recall.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use strict;
22
use warnings;
3-
use PostgresNode;
4-
use TestLib;
3+
use PostgreSQL::Test::Cluster;
4+
use PostgreSQL::Test::Utils;
55
use Test::More;
66

77
my $node;
@@ -49,7 +49,7 @@ sub test_recall
4949
}
5050

5151
# Initialize node
52-
$node = get_new_node('node');
52+
$node = PostgreSQL::Test::Cluster->new('node');
5353
$node->init;
5454
$node->start;
5555

test/t/004_ivfflat_vector_insert_recall.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use strict;
22
use warnings;
3-
use PostgresNode;
4-
use TestLib;
3+
use PostgreSQL::Test::Cluster;
4+
use PostgreSQL::Test::Utils;
55
use Test::More;
66

77
my $node;
@@ -48,7 +48,7 @@ sub test_recall
4848
}
4949

5050
# Initialize node
51-
$node = get_new_node('node');
51+
$node = PostgreSQL::Test::Cluster->new('node');
5252
$node->init;
5353
$node->start;
5454

test/t/005_ivfflat_query_recall.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use strict;
22
use warnings;
3-
use PostgresNode;
4-
use TestLib;
3+
use PostgreSQL::Test::Cluster;
4+
use PostgreSQL::Test::Utils;
55
use Test::More;
66

77
# Initialize node
8-
my $node = get_new_node('node');
8+
my $node = PostgreSQL::Test::Cluster->new('node');
99
$node->init;
1010
$node->start;
1111

0 commit comments

Comments
 (0)