Closed flimzy closed 3 months ago
How about adding an env variable to choose databases? For example TXDB_TEST_DB=sqlite
. Then you don't need any docker things on local machine. Github action will always run with postgres and mysql to make sure everything works.
I'm in favor of env variables, but I see that as a great addition to the use of testcontainers. Testcontainers also works great in GitHub actions, so could serve to simplify and unify test running both in local development and in CI.
I'm happy to throw together a PoC PR for your review, @Yiling-J.
env and testcontainer? That will be cool. @flimzy
The current test suite depends on locally running MySQL and PostgreSQL instances, and fails rather spectacularly when it cannot connect:
I suggest we use go-testcontainers, or a similar tool, to run these tests so to ease the maintenence and writing of tests.