From 2826456afe57a0c4c59564e0ce4e0138bd218f76 Mon Sep 17 00:00:00 2001 From: wass3r <1301201+wass3r@users.noreply.github.com> Date: Wed, 5 Jun 2024 11:42:00 -0500 Subject: [PATCH] extend test struct with new fields --- database/database_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/database/database_test.go b/database/database_test.go index 26ea7e471..a8b70111a 100644 --- a/database/database_test.go +++ b/database/database_test.go @@ -32,6 +32,10 @@ func TestDatabase_New(t *testing.T) { ConnectionOpen: 20, EncryptionKey: "A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW", SkipCreation: false, + LogLevel: "info", + LogSkipNotFound: true, + LogSlowThreshold: 100 * time.Millisecond, + LogShowSQL: false, }, }, { @@ -46,6 +50,10 @@ func TestDatabase_New(t *testing.T) { ConnectionOpen: 20, EncryptionKey: "A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW", SkipCreation: false, + LogLevel: "info", + LogSkipNotFound: true, + LogSlowThreshold: 100 * time.Millisecond, + LogShowSQL: false, }, }, { @@ -60,6 +68,10 @@ func TestDatabase_New(t *testing.T) { ConnectionOpen: 20, EncryptionKey: "A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW", SkipCreation: false, + LogLevel: "info", + LogSkipNotFound: true, + LogSlowThreshold: 100 * time.Millisecond, + LogShowSQL: false, }, }, { @@ -74,6 +86,10 @@ func TestDatabase_New(t *testing.T) { ConnectionOpen: 20, EncryptionKey: "A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW", SkipCreation: false, + LogLevel: "info", + LogSkipNotFound: true, + LogSlowThreshold: 100 * time.Millisecond, + LogShowSQL: false, }, }, } @@ -88,6 +104,10 @@ func TestDatabase_New(t *testing.T) { WithConnectionIdle(test.config.ConnectionIdle), WithConnectionOpen(test.config.ConnectionOpen), WithDriver(test.config.Driver), + WithLogLevel(test.config.LogLevel), + WithLogShowSQL(test.config.LogShowSQL), + WithLogSkipNotFound(test.config.LogSkipNotFound), + WithLogSlowThreshold(test.config.LogSlowThreshold), WithEncryptionKey(test.config.EncryptionKey), WithSkipCreation(test.config.SkipCreation), ) @@ -119,6 +139,10 @@ func testPostgres(t *testing.T) (*engine, sqlmock.Sqlmock) { Driver: "postgres", EncryptionKey: "A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW", SkipCreation: false, + LogLevel: "info", + LogSkipNotFound: true, + LogSlowThreshold: 100 * time.Millisecond, + LogShowSQL: false, }, logger: logrus.NewEntry(logrus.StandardLogger()), } @@ -161,6 +185,10 @@ func testSqlite(t *testing.T) *engine { Driver: "sqlite3", EncryptionKey: "A1B2C3D4E5G6H7I8J9K0LMNOPQRSTUVW", SkipCreation: false, + LogLevel: "info", + LogSkipNotFound: true, + LogSlowThreshold: 100 * time.Millisecond, + LogShowSQL: false, }, logger: logrus.NewEntry(logrus.StandardLogger()), }