Skip to content

db_testing: drop existing test databases

Warren Gifford requested to merge fix-test-db into master

Created by: ggilmore

Currently, TestContext(t *testing.T) always rolls the database forward to the latest migration. However:

  • these migrations are never undone during testing
  • the test databases are re-used for different CI builds

So, it's possible for a build to be broken in CI because the Buildkite agent that it's running on previously ran a build that had a migration that hasn't landed in master yet.

This PR solves this by ensuring that the test database is re-created from scratch every time that a build runs in CI.

Merge request reports

Loading