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:
Elle Mouton committed 2025-07-15 18:06:05 +02:00
1 parent df6c02e3af
commit 955f4c9182
4 files changed
+82 -24

No files matched your search

+4 -1
View File
@@ -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.