Guard against running tests on non-test DBs
Fixed env db selection