diff --git a/internal/manager/persistence/jobs_test.go b/internal/manager/persistence/jobs_test.go index c54e17ed..d95a8e9b 100644 --- a/internal/manager/persistence/jobs_test.go +++ b/internal/manager/persistence/jobs_test.go @@ -31,7 +31,7 @@ import ( ) func TestStoreAuthoredJob(t *testing.T) { - db := createTestDB(t) + db := CreateTestDB(t) ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) defer cancel() diff --git a/internal/manager/persistence/db_test.go b/internal/manager/persistence/test_support.go similarity index 93% rename from internal/manager/persistence/db_test.go rename to internal/manager/persistence/test_support.go index a9b4637f..ae36c01c 100644 --- a/internal/manager/persistence/db_test.go +++ b/internal/manager/persistence/test_support.go @@ -30,14 +30,14 @@ import ( "gorm.io/gorm" ) -const testURI = "host=localhost user=flamenco password=flamenco dbname=flamenco-test TimeZone=Europe/Amsterdam" +const TestDSN = "host=localhost user=flamenco password=flamenco dbname=flamenco-test TimeZone=Europe/Amsterdam" -func createTestDB(t *testing.T) *DB { +func CreateTestDB(t *testing.T) *DB { // Creating a new database should be fast. ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) defer cancel() - db, err := openDB(ctx, testURI) + db, err := openDB(ctx, TestDSN) assert.NoError(t, err) // Erase everything in the database. diff --git a/internal/manager/persistence/workers_test.go b/internal/manager/persistence/workers_test.go index 82c3268c..767d59db 100644 --- a/internal/manager/persistence/workers_test.go +++ b/internal/manager/persistence/workers_test.go @@ -32,7 +32,7 @@ import ( ) func TestCreateFetchWorker(t *testing.T) { - db := createTestDB(t) + db := CreateTestDB(t) ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) defer cancel()