Re: TAP tests and symlinks on Windows

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TAP tests and symlinks on Windows
Date: 2020-06-30 12:13:28
Message-ID: 20200630121328.GB67289@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 29, 2020 at 04:56:16PM +0900, Michael Paquier wrote:
> On Fri, Jun 26, 2020 at 02:00:37PM +0200, Peter Eisentraut wrote:
>> We should be more accurate about things like this:
>>
>> +# The following tests test symlinks. Windows may not have symlinks, so
>> +# skip there.
>>
>> The issue isn't whether Windows has symlinks, since all versions of Windows
>> supported by PostgreSQL do (AFAIK). The issue is only whether the Perl
>> installation that runs the tests has symlink support. And that is only
>> necessary if the test itself wants to create or inspect symlinks. For
>> example, there are existing tests involving tablespaces that work just fine
>> on Windows.
>
> Check. Indeed that sounds confusing.

Attached is an updated patch, where I have tried to use a better
wording in all the code paths involved.

>> Relatedly, your patch ends up skipping the tests on MSYS2, even though Perl
>> supports symlinks there out of the box.
>
> Do you think that it would be enough to use what Andrew has mentioned
> in [1]? I don't have a MSYS2 installation, so I am unfortunately not
> able to confirm that, but I would just move the check to TestLib.pm
> and save it in an extra variable.

Added an extra $is_msys2 to track that in TestLib.pm. One thing I am
not sure of though: Win32::Symlink fails to work properly with -l, but
is that the case with MSYS2? If that's able to work, it would be
possible to not skip the following test but I have taken the most
careful approach for now:
+ # This symlink check is not supported on Windows. Win32::Symlink works
+ # around this situation by using junction points (actually PostgreSQL
+ # approach on the problem), and -l is not able to detect that situation.
+ SKIP:
+ {
+ skip "symlink check not implemented on Windows", 1
+ if ($windows_os)

Thanks,
--
Michael

Attachment Content-Type Size
win32-readlink-tap-v3.patch text/x-diff 6.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-06-30 12:18:04 Re: Missing some ifndef FRONTEND at the top of logging.c and file_utils.c
Previous Message Amit Kapila 2020-06-30 11:50:14 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions