How to install on Windows 10?

333 views
Skip to first unread message

Eric Mamet

unread,
Mar 29, 2019, 7:59:10 AM3/29/19
to pgTAP Users
I try to follow various instructions on installing pgtap on a windows 10 client and it all falls down...

I try to run WSL bash

For instance, the first "make" returns 

Makefile:40: C:/Program: No such file or directory
Makefile:40: Files/PostgreSQL/11/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target 'Files/PostgreSQL/11/lib/pgxs/src/makefiles/pgxs.mk'.  Stop.

then sudo make install returns

make: pg_config: Command not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
/bin/sh: 1: pg_config: not found
make: *** No rule to make target 'install'.  Stop.

As an alternative, I tried to hack the pgtap.sql manually from pgtap.sql.in but then I am missing thinks like pg_prove, etc...

Is there a way to install this in Windows? 

Thanks

Eric

Eric Mamet

unread,
Mar 29, 2019, 8:01:36 AM3/29/19
to pgTAP Users
I forgot to mention that my Postgresql is on AWS RDS... hence I can't install it "on the server"...

kevin

unread,
Mar 29, 2019, 8:18:48 PM3/29/19
to pgtap...@googlegroups.com
On 3/29/19 7:01 AM, Eric Mamet wrote:
I forgot to mention that my Postgresql is on AWS RDS... hence I can't install it "on the server"...
--

Pgtap is an extension, and like all extensions, it extends the database server, hence by definition it must be installed "on the server".

I really wouldn't want to do it, but I suppose if you were determined enough and had enough time, you could install a local Pg server and put Pgtap there, then with the FDW extension, reach out to the other server. That's assuming you have security setup to allow that to happen and it's quite possible that ability is not allowed -- we certainly don't allow it on our production servers though I probably could on our dev servers, then again, it's dev so I can install Pgtap there.

I suppose another option is to copy the DB from your AWS server to you dev server, then you could run Pgtap there against a copy of the data in AWS.

HTH,
Kevin

David E. Wheeler

unread,
Apr 1, 2019, 9:47:15 PM4/1/19
to Eric Mamet, pgTAP Users
On Mar 29, 2019, at 07:59, Eric Mamet <openres...@gmail.com> wrote:

> I try to follow various instructions on installing pgtap on a windows 10 client and it all falls down...
>
> I try to run WSL bash
>
> For instance, the first "make" returns
>
> Makefile:40: C:/Program: No such file or directory
> Makefile:40: Files/PostgreSQL/11/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
> make: *** No rule to make target 'Files/PostgreSQL/11/lib/pgxs/src/makefiles/pgxs.mk'. Stop.
>
> then sudo make install returns
>
> make: pg_config: Command not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> /bin/sh: 1: pg_config: not found
> make: *** No rule to make target 'install'. Stop.

In order to build pgTAP, you need to run it on a system with the same version of Postgres installed as is on your server. Since you’re using RDS, which I assume is Linux-based (ish), try building it on a Docker image or VM with that version of Postgres and grab the ptap.sql and pgtap_uninstall files. You can then install pgtap by simply running pgtap.sql through psql or whatever interface RDS gives you.

> As an alternative, I tried to hack the pgtap.sql manually from pgtap.sql.in but then I am missing thinks like pg_prove, etc…

pg_prove does not come with pgTAP, but is a separate install. On Windows, you’ll want to install Strawberry Perl and then run `cpanm TAP::Parser::SourceHandler::pgTAP`. Then you’ll have pg_prove; but note that it requires psql, so you will need that, too.

> Is there a way to install this in Windows?

If you don’t want to mess with Strawberry Perl and whatnot to get pg_prove, consider using the pg_prove Docker image:

https://hub.docker.com/r/itheory/pg_prove

You’ll still need to put your tests somewhere, though.

HTH,

David

signature.asc
Reply all
Reply to author
Forward
0 new messages