Skip to content

Commit 33f3bbc

Browse files
committed
Fix TAP infrastructure to support Mingw better
archive_command and restore_command need to refer to Windows paths, not Msys virtual file system paths, as postgres is completely unaware of the latter, so prefix them with the Windows path to the virtual file system root. Clean psql and pg_recvlogical output of carriage returns.
1 parent 7d68f22 commit 33f3bbc

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/test/perl/PostgresNode.pm

+15-2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ our @EXPORT = qw(
101101

102102
our ($test_localhost, $test_pghost, $last_port_assigned, @all_nodes);
103103

104+
# Windows path to virtual file system root
105+
106+
our $vfs_path = '';
107+
if ($Config{osname} eq 'msys')
108+
{
109+
$vfs_path = `cd / && pwd -W`;
110+
chomp $vfs_path;
111+
}
112+
104113
INIT
105114
{
106115

@@ -763,7 +772,7 @@ standby_mode=on
763772
sub enable_restoring
764773
{
765774
my ($self, $root_node) = @_;
766-
my $path = $root_node->archive_dir;
775+
my $path = $vfs_path . $root_node->archive_dir;
767776
my $name = $self->name;
768777

769778
print "### Enabling WAL restore for node \"$name\"\n";
@@ -791,7 +800,7 @@ standby_mode = on
791800
sub enable_archiving
792801
{
793802
my ($self) = @_;
794-
my $path = $self->archive_dir;
803+
my $path = $vfs_path . $self->archive_dir;
795804
my $name = $self->name;
796805

797806
print "### Enabling WAL archiving for node \"$name\"\n";
@@ -979,6 +988,7 @@ sub safe_psql
979988
print "\n#### End standard error\n";
980989
}
981990

991+
$stdout =~ s/\r//g if $TestLib::windows_os;
982992
return $stdout;
983993
}
984994

@@ -1579,6 +1589,9 @@ sub pg_recvlogical_upto
15791589
}
15801590
};
15811591

1592+
$stdout =~ s/\r//g if $TestLib::windows_os;
1593+
$stderr =~ s/\r//g if $TestLib::windows_os;
1594+
15821595
if (wantarray)
15831596
{
15841597
return ($ret, $stdout, $stderr, $timeout);

0 commit comments

Comments
 (0)