graph/db: refactor to make postgres fixtures re-usable
In preparation for tests where we will want to spin up SQL DBs many times, we do some refactoring so that it is easy to re-use postgres fixtures since those are expensive to spin up.
This commit is contained in:
4 files changed
+82
-24
No files matched your search
@@ -58,6 +58,8 @@ func TestMigrateGraphToSQL(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := context.Background()
|
||||
|
||||
dbFixture := NewTestDBFixture(t)
|
||||
|
||||
writeUpdate := func(t *testing.T, db *KVStore, object any) {
|
||||
t.Helper()
|
||||
|
||||
@@ -324,7 +326,8 @@ func TestMigrateGraphToSQL(t *testing.T) {
|
||||
}
|
||||
|
||||
// Set up our destination SQL DB.
|
||||
sql, ok := NewTestDB(t).(*SQLStore)
|
||||
db := NewTestDBWithFixture(t, dbFixture)
|
||||
sql, ok := db.(*SQLStore)
|
||||
require.True(t, ok)
|
||||
|
||||
// Run the migration.
|
||||
|
||||
Reference in new issue
Block a user