Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-nicolas committed Oct 2, 2023
1 parent 57fca75 commit 3795cf4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/internal/analytics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func TestAnalyticsModule(t *testing.T) {
module,
fx.Provide(func(lc fx.Lifecycle) (storage.Driver[ledger.Store], error) {
id := uuid.New()
driver := sqlstorage.NewDriver("sqlite", sqlstorage.NewSQLiteDB(os.TempDir(), id))
driver := sqlstorage.NewDriver("sqlite", sqlstorage.NewSQLiteDB(os.TempDir(), id), false)
lc.Append(fx.Hook{
OnStart: driver.Initialize,
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/analytics/segment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ var (
}),
fx.Provide(func(lc fx.Lifecycle) (storage.Driver[ledger.Store], error) {
id := uuid.New()
driver := sqlstorage.NewDriver("sqlite", sqlstorage.NewSQLiteDB(os.TempDir(), id))
driver := sqlstorage.NewDriver("sqlite", sqlstorage.NewSQLiteDB(os.TempDir(), id), false)
lc.Append(fx.Hook{
OnStart: driver.Initialize,
})
Expand Down
3 changes: 2 additions & 1 deletion pkg/ledgertesting/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func StorageDriver() (*sqlstorage.Driver, func(), error) {
switch StorageDriverName() {
case "sqlite":
id := uuid.New()
return sqlstorage.NewDriver("sqlite", sqlstorage.NewSQLiteDB(os.TempDir(), id)), func() {}, nil
return sqlstorage.NewDriver("sqlite", sqlstorage.NewSQLiteDB(os.TempDir(), id), false), func() {}, nil

Check warning on line 29 in pkg/ledgertesting/storage.go

View check run for this annotation

Codecov / codecov/patch

pkg/ledgertesting/storage.go#L29

Added line #L29 was not covered by tests
case "postgres":
pgServer, err := pgtesting.PostgresServer()
if err != nil {
Expand All @@ -39,6 +39,7 @@ func StorageDriver() (*sqlstorage.Driver, func(), error) {
return sqlstorage.NewDriver(
"postgres",
sqlstorage.NewPostgresDB(db),
false,
), func() {
_ = pgServer.Close()
}, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/sqlstorage/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestAccounts(t *testing.T) {
d := NewDriver("sqlite", &sqliteDB{
directory: os.TempDir(),
dbName: uuid.New(),
})
}, false)

assert.NoError(t, d.Initialize(context.Background()))

Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/sqlstorage/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestNewDriver(t *testing.T) {
d := NewDriver("sqlite", &sqliteDB{
directory: os.TempDir(),
dbName: uuid.New(),
})
}, false)

assert.NoError(t, d.Initialize(context.Background()))

Expand All @@ -39,7 +39,7 @@ func TestConfiguration(t *testing.T) {
d := NewDriver("sqlite", &sqliteDB{
directory: os.TempDir(),
dbName: uuid.New(),
})
}, false)
require.NoError(t, d.Initialize(context.Background()))

require.NoError(t, d.GetSystemStore().InsertConfiguration(context.Background(), "foo", "bar"))
Expand Down

0 comments on commit 3795cf4

Please sign in to comment.