Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow tests without requiring Unix sockets #21

Closed
omus opened this issue Jan 10, 2018 · 2 comments
Closed

Allow tests without requiring Unix sockets #21

omus opened this issue Jan 10, 2018 · 2 comments

Comments

@omus
Copy link
Contributor

omus commented Jan 10, 2018

Usually when I am interacting with a local Postgres server I end up use a Docker container. It would be nice if you allowed an environmental variable to specify the connection string such that I could supply the port number of my database server.

For example if I wanted to run the tests using a PostgreSQL container I could run the following to get a working PostgreSQL running on localhost:5555 using the user "postgres" with no password:

docker run --name libpq-test -p 5555:5432 -d postgres
@iamed2
Copy link
Owner

iamed2 commented Jan 10, 2018

The option to do this already exists in PostgreSQL: https://www.postgresql.org/docs/10/static/libpq-envars.html

@iamed2 iamed2 closed this as completed Jan 10, 2018
@omus
Copy link
Contributor Author

omus commented Jan 10, 2018

Ah, thank you. Sorry for the noise. Tests now work with the above container and:

julia> ENV["PGHOST"] = "localhost"
"localhost"

julia> ENV["PGPORT"] = 5555
5555

julia> Pkg.test("LibPQ")
...
INFO: LibPQ tests passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants