Skip to content

Commit

Permalink
extend test struct with new fields
Browse files Browse the repository at this point in the history
  • Loading branch information
wass3r committed Jun 5, 2024
1 parent 0a49261 commit 2826456
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions database/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
{
Expand All @@ -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,
},
},
{
Expand All @@ -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,
},
},
{
Expand All @@ -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,
},
},
}
Expand All @@ -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),
)
Expand Down Expand Up @@ -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()),
}
Expand Down Expand Up @@ -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()),
}
Expand Down

0 comments on commit 2826456

Please sign in to comment.