Make sure the test database exists before running the polyglot tests

Closes #684
Review 562 by @mlucy