How to run unit tests against other databases than H2?


I’m trying to make a contrib for metabase, which I need to test against a few different database types. It is a little unclear how to run the unit tests against other databases.

Dev docs mention that the tests can run against different DB drivers by changing an env var called ENGINES. And that is about it. They don’t explain how the tests actually access an running instance of a DB to do the tests. By trial and error I discovered that at least with Postgres, if I have a blank default DB running on localhost with no password when I run the unit tests, then some tests appear to be run. However I get some unit test failures when doing this, even when running against an unmodified master branch. So I’m not sure this is quite right.

It also appears that some unit tests don’t run on certain DB engines… but it’s unclear why this is or where it’s configured. The particular functionality I am testing involves changes to the metabase.sync.sync-metadata.tables-test test. I can get it working on H2, but when running on postgres, this test appears to be skipped.

Can anyone point me to docs that explain more about how to run tests against different dbs… or if not, provide specific answers to the above issues?