8000 PGPRO-5983: fix Perl tests due to changes in PostgreSQL 15devel by MarinaPolyakova · Pull Request #15 · postgrespro/ptrack · GitHub
[go: up one dir, main page]

Skip to content

PGPRO-5983: fix Perl tests due to changes in Po 8000 stgreSQL 15devel #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 37 additions & 10 deletions t/001_basic.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,52 @@

use strict;
use warnings;
use PostgresNode;
use TestLib;
use Test::More;

my $pg_15_modules;

BEGIN
{
$pg_15_modules = eval
{
require PostgreSQL::Test::Cluster;
require PostgreSQL::Test::Utils;
return 1;
};

unless (defined $pg_15_modules)
{
$pg_15_modules = 0;

require PostgresNode;
require TestLib;
}
}

plan tests => 24;

note('PostgreSQL 15 modules are used: ' . ($pg_15_modules ? 'yes' : 'no'));

my $node;
my $res;
my $res_stdout;
my $res_stderr;

# Initialize node
# Older version of PostgresNode.pm use get_new_node function.
# Newer use standard perl object constructor syntax
if (PostgresNode->can('get_new_node')) {
$node = get_new_node('node');
} else {
$node = PostgresNode->new("node");
}
# Create node.
# Older versions of PostgreSQL modules use get_new_node function.
# Newer use standard perl object constructor syntax.
eval
{
if ($pg_15_modules)
{
$node = PostgreSQL::Test::Cluster->new("node");
}
else
{
$node = PostgresNode::get_new_node("node");
}
};

$node->init;
$node->start;

Expand Down
0