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