From c76e39bb0ef623c721b2364dacfc5ce50dbb2443 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Sat, 21 Feb 2026 10:36:09 -0500 Subject: [PATCH] Manual updates --- db/test/test.go | 10 +++++----- message/store_postgres_test.go | 2 +- server/server_test.go | 2 +- user/manager_test.go | 2 +- user/store_postgres_test.go | 2 +- webpush/store_postgres_test.go | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/db/test/test.go b/db/test/test.go index 18f36049..d843becb 100644 --- a/db/test/test.go +++ b/db/test/test.go @@ -14,10 +14,10 @@ import ( const testPoolMaxConns = "2" -// CreateTestSchema creates a temporary PostgreSQL schema and returns the DSN pointing to it. +// CreateTestPostgresSchema creates a temporary PostgreSQL schema and returns the DSN pointing to it. // It registers a cleanup function to drop the schema when the test finishes. // If NTFY_TEST_DATABASE_URL is not set, the test is skipped. -func CreateTestSchema(t *testing.T) string { +func CreateTestPostgresSchema(t *testing.T) string { t.Helper() dsn := os.Getenv("NTFY_TEST_DATABASE_URL") if dsn == "" { @@ -48,12 +48,12 @@ func CreateTestSchema(t *testing.T) string { return schemaDSN } -// CreateTestDB creates a temporary PostgreSQL schema and returns an open *sql.DB connection to it. +// CreateTestPostgres creates a temporary PostgreSQL schema and returns an open *sql.DB connection to it. // It registers cleanup functions to close the DB and drop the schema when the test finishes. // If NTFY_TEST_DATABASE_URL is not set, the test is skipped. -func CreateTestDB(t *testing.T) *sql.DB { +func CreateTestPostgres(t *testing.T) *sql.DB { t.Helper() - schemaDSN := CreateTestSchema(t) + schemaDSN := CreateTestPostgresSchema(t) testDB, err := db.OpenPostgres(schemaDSN) require.Nil(t, err) t.Cleanup(func() { diff --git a/message/store_postgres_test.go b/message/store_postgres_test.go index 3dec51a2..522620db 100644 --- a/message/store_postgres_test.go +++ b/message/store_postgres_test.go @@ -10,7 +10,7 @@ import ( ) func newTestPostgresStore(t *testing.T) message.Store { - testDB := dbtest.CreateTestDB(t) + testDB := dbtest.CreateTestPostgres(t) store, err := message.NewPostgresStore(testDB, 0, 0) require.Nil(t, err) return store diff --git a/server/server_test.go b/server/server_test.go index 2acdbac1..46881593 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -4128,7 +4128,7 @@ func forEachBackend(t *testing.T, f func(t *testing.T, databaseURL string)) { f(t, "") }) t.Run("postgres", func(t *testing.T) { - f(t, dbtest.CreateTestSchema(t)) + f(t, dbtest.CreateTestPostgresSchema(t)) }) } diff --git a/user/manager_test.go b/user/manager_test.go index 014bb149..d903332f 100644 --- a/user/manager_test.go +++ b/user/manager_test.go @@ -33,7 +33,7 @@ func forEachBackend(t *testing.T, f func(t *testing.T, newStore newStoreFunc)) { }) }) t.Run("postgres", func(t *testing.T) { - schemaDSN := dbtest.CreateTestSchema(t) + schemaDSN := dbtest.CreateTestPostgresSchema(t) f(t, func() Store { pool, err := db.OpenPostgres(schemaDSN) require.Nil(t, err) diff --git a/user/store_postgres_test.go b/user/store_postgres_test.go index 319e9aa8..e3902ea2 100644 --- a/user/store_postgres_test.go +++ b/user/store_postgres_test.go @@ -9,7 +9,7 @@ import ( ) func newTestPostgresStore(t *testing.T) user.Store { - testDB := dbtest.CreateTestDB(t) + testDB := dbtest.CreateTestPostgres(t) store, err := user.NewPostgresStore(testDB) require.Nil(t, err) return store diff --git a/webpush/store_postgres_test.go b/webpush/store_postgres_test.go index 4c675c82..1b2d43d2 100644 --- a/webpush/store_postgres_test.go +++ b/webpush/store_postgres_test.go @@ -9,7 +9,7 @@ import ( ) func newTestPostgresStore(t *testing.T) webpush.Store { - testDB := dbtest.CreateTestDB(t) + testDB := dbtest.CreateTestPostgres(t) store, err := webpush.NewPostgresStore(testDB) require.Nil(t, err) return store