-
Notifications
You must be signed in to change notification settings - Fork 4
Description
To the best of my understanding, this "magically" uses the Postgresql executable to create a separate database. This works great for testing on my machine, but when I want to run these test on my CI environment (using gitlab's ci/cd toolchain) I run into a problem.
I either need to install postgresql on the docker image the tests run on or use a pre installed postgresql image. further when I try these approaches I run into other problems, for example it doesn't like that the tests are running as root.
Ideally, I could still have a way to use a live database, which you can setup and demolish using "services": postgres:latest in the .gitlab-ci.yml file as part of the normal CI pipeline.
For the time being, I will probably add a fixture to conftest.py that checks some environment variables and either returns a real postgresql db context or a pytest-psql postgresql_db context depending on the environment.
Would be cool if i could just set some options to pass a real database connection details instead.
Apologies if this is already possible I couldn't find out how.