matthewfranglen / postgres-elasticsearch-fdw

Postgres to Elastic Search Foreign Data Wrapper
MIT License
108 stars 32 forks source link

tests: Add trust auth for all pg versions #14

Closed aileo closed 3 years ago

aileo commented 3 years ago

I had this error running tests:

docker logs pg-9.4
Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD for the superuser. Use
       "-e POSTGRES_PASSWORD=password" to set it in "docker run".

       You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
       without a password. This is *not* recommended. See PostgreSQL
       documentation about "trust":
       https://www.postgresql.org/docs/current/auth-trust.html

So I added POSTGRES_HOST_AUTH_METHOD=trust environment variable to the common docker-compose.yml

matthewfranglen commented 3 years ago

If you follow that link you can see that the auth-trust parameter is only supported for postgres versions 11, 12, and 13. The environmental variable is only required for postgres 12+. The variable is already set in the associated docker-compose file. As such I do not think this is an appropriate PR to merge, sorry.

matthewfranglen commented 3 years ago

I'm pulling fresh versions of all postgres images and will run the tests again, just to be sure.

aileo commented 3 years ago

My pg-9.4 was stuck due to this message, and adding this solved it. but it could be a mistake on the postgres docker side, like the initialization script doing some inappropriate verification against that environment variable

matthewfranglen commented 3 years ago

I can certainly reproduce it being stuck!

aileo commented 3 years ago

https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh#L94

If I read this correctly, the postgres image check for the environment variables no matter the version.

matthewfranglen commented 3 years ago

Ah nice find. Yeah after applying this change the tests run with postgres 9.4 etc. Takes so long to run them all that I haven't verified further than that.

matthewfranglen commented 3 years ago

Thank you for this PR