Re: Supporting TAP tests with MSVC and Windows - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Supporting TAP tests with MSVC and Windows
Date
Msg-id CAB7nPqSHObwq89SydPYWWBafXEm=6qcxskU1-OqQOR3Zf8PrCw@mail.gmail.com
Whole thread Raw
In response to Re: Supporting TAP tests with MSVC and Windows  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Supporting TAP tests with MSVC and Windows
List pgsql-hackers
On Fri, Apr 10, 2015 at 11:29 AM, Michael Paquier wrote:
> Here is a v2 with the following changes:
> - Use an environment variable to define where pg_regress is located.
> - Use SSPI to access a node in the tests, to secure the test environment.
> - Rebase on latest HEAD
> - SSL tests are run only if build is configured with openssl
>
> A couple of things to note:
> - pg_rewind tests are still disabled, waiting for the outcome of
> 5519F169.8030406@gmx.net. They will need some tweaks.
> - SSL tests can work if an equivalent of cp is available, like
> something installed with msysgit... IMO the scripts in src/test/ssl
> should be patched to be made more portable (see
> http://www.postgresql.org/message-id/CAB7nPqQivFxnSjPwkyapa8=HTGm0hfDNvdGcM3=hkK6fPT0+Pg@mail.gmail.com)
> - I tested the scripts with MinGW and this patch and got them working.
> As prove can fail because of a bad perl interpreter, pointing to
> /usr/bin/perl, it is necessary to enforce "PROVE = c:\Perl64\bin\perl
> c:\Perl64\bin\prove" or similar. That's not beautiful, but it works,
> and the t/ scripts need no further modifications. At least I checked
> that.

And here is v3 with support for pg_rewind tests. One thing that I
noticed with this stuff is that the log redirection fails on Windows
with "cannot access file because it is used by another process",
because of system_or_bail that is used by a set of pg_ctl commands in
RewindTest.pm to stop, start and promote the test servers. I am
attaching a second patch switching those calls from system_or_bail to
IPC's run(), making the log capture method completely consistent
across platforms. In the first patch log redirection is done to NUL to
make the test work even if log output is lost, the split is done for
clarity and those patches should be applied together.

Note as well that this patch uses the following patches fixing
independent issues:
- Replace use of rm in initdb tests by rmtree:
http://www.postgresql.org/message-id/CAB7nPqQqzjSHxnCPYCO5vr2dmELt8DqedETqRZmj7TMNqb5Bkg@mail.gmail.com
- Add --debug for pg_rewind remote mode:
http://www.postgresql.org/message-id/CAB7nPqSMRFZcfB-b6Un8KvnJKWNLi+qckkXgsy1Fu4dQBif=gw@mail.gmail.com
- Improve sleep processing of pg_rewind, windows being sometimes
susceptible about that as well...
http://www.postgresql.org/message-id/CAB7nPqSQfTfge-whbpRD99BEbJOX3Z+Pepwa+TUBxA0fDtuVyg@mail.gmail.com
Regards,
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: RewindTest.pm missing --debug for remote mode in pg_rewind tests
Next
From: Mikko Tiihonen
Date:
Subject: [PATCH] libpq: Allow specifying multiple host names to try to connect to