Route the delivery tests' gorm.Open through gormlog (closes #462)
check / check (push) Successful in 3m11s
check / check (push) Successful in 3m11s
The six gorm.Open calls in the internal/delivery tests passed a bare gorm.Config, which installs GORM's default logger; they now pass gormlog.New over a logger that discards, as every production call does, so the unfiltered form is no longer in the tree to be copied. The README and the ParamsFilter comment said (*gorm.DB).Scan had one test-only caller; there are more. Both now say only tests call it, with fixture data. Model: opus-5-5
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
_ "modernc.org/sqlite"
|
||||
"sneak.berlin/go/webhooker/internal/database"
|
||||
"sneak.berlin/go/webhooker/internal/delivery"
|
||||
"sneak.berlin/go/webhooker/internal/gormlog"
|
||||
"sneak.berlin/go/webhooker/internal/metrics"
|
||||
)
|
||||
|
||||
@@ -49,7 +50,8 @@ func testWebhookDB(t *testing.T) *gorm.DB {
|
||||
t.Cleanup(func() { _ = sqlDB.Close() })
|
||||
|
||||
db, err := gorm.Open(
|
||||
sqlite.Dialector{Conn: sqlDB}, &gorm.Config{},
|
||||
sqlite.Dialector{Conn: sqlDB},
|
||||
&gorm.Config{Logger: gormlog.New(slog.New(slog.DiscardHandler))},
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user