Search code examples
postgresqlunit-testingautomated-testsrdbmspgtap

How do I set the database password for pg_prove in PgTAP?


Just getting started with pgTAP, I'm using a localhost running docker container server. How do I tell pgTAP what the password for that server is? I don't see anything mentioned in the documentation.


Solution

  • PgTAP pg_prove respects the PostgreSQL Environment Vars, so you need to set PGPASSWORD in the environment before running. Since pg_prove runs using psql I suspect you can also set a ~/.pgpass.