api icon indicating copy to clipboard operation
api copied to clipboard

Adding a Postgres database dependency to test with Docker?

Open metalmatze opened this issue 4 years ago • 4 comments

So far we have all tests running straight up binaries. I don't think that's feasible with Postgres anymore. I'm happy to be proven otherwise, but I think running a simple Docker container makes a lot more sense for this going forward.

Isn't this a big deal to begin with or should we try to make it work without Docker?

WDYT?

metalmatze avatar Dec 08 '20 17:12 metalmatze

I'm ok with using containers in the testing environment. Actually, in the first version of the tests, I have used docker and docker-compose for Observatorium API.

There are good initiatives out there to make life easier to test with docker. For example https://github.com/testcontainers/testcontainers-go. It worths checking it out.

Let's see what other maintainers also think.

kakkoyun avatar Dec 08 '20 18:12 kakkoyun

docker is ok to me (:

bwplotka avatar Dec 08 '20 19:12 bwplotka

Since we use kind for testing, using docker shouldn't be a thing blocking us. If we intend to use postgres as a backend for the observatorium-api, then why not package the deployment for tests in jsonnet and install it along with former in kind? Am I missing the point here?

periklis avatar Dec 09 '20 07:12 periklis

Sgtm, even using a programmatic framework like test containers sounds awesome. However, I worry that a full blown overhaul will be a big effort that will hold up the PostgreSQL work for a long time. Can we do an intermediate transition to make things work in the short term and then a full migration? Specifically, keep the test script as is and just run PostgreSQL with docker and later, after the PostgreSQL work is merged, do a full overhaul. WDYT?

squat avatar Dec 09 '20 08:12 squat