Re: Supporting TAP tests with MSVC and Windows

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Supporting TAP tests with MSVC and Windows
Date: 2015-04-19 13:01:40
Message-ID: CAB7nPqSHObwq89SydPYWWBafXEm=6qcxskU1-OqQOR3Zf8PrCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)8030406(at)gmx(dot)net(dot) 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 Content-Type Size
0001-Add-support-for-TAP-tests-on-Windows.patch text/x-patch 23.9 KB
0002-Prefer-IPC-s-run-to-system_or_bail-in-pg_rewind-test.patch text/x-patch 4.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikko Tiihonen 2015-04-19 15:18:10 [PATCH] libpq: Allow specifying multiple host names to try to connect to
Previous Message Michael Paquier 2015-04-19 12:00:49 RewindTest.pm missing --debug for remote mode in pg_rewind tests