RDBMS cleanup, init logger in store tests
This commit is contained in:
@@ -56,8 +56,6 @@ func (s *Store) Upgrade(ctx context.Context, log *zap.Logger) (err error) {
|
||||
return (&rdbms.Schema{}).Upgrade(ctx, NewUpgrader(log, s))
|
||||
}
|
||||
|
||||
//func (s *Store) Crea
|
||||
|
||||
// ProcDataSourceName validates given DSN and ensures
|
||||
// params are present and correct
|
||||
//
|
||||
|
||||
@@ -168,7 +168,11 @@ func (s Store) tryToConnect(ctx context.Context, db *sqlx.DB) error {
|
||||
}
|
||||
}
|
||||
|
||||
s.log(ctx).Debug("connected to the database")
|
||||
s.log(ctx).
|
||||
// Make a small adjustment when
|
||||
// collecting callers from the callstack for this
|
||||
WithOptions(zap.AddCallerSkip(-2)).
|
||||
Debug("connected to the database")
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package tests
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/cortezaproject/corteza-server/pkg/logger"
|
||||
"github.com/cortezaproject/corteza-server/store"
|
||||
"github.com/cortezaproject/corteza-server/store/mysql"
|
||||
"github.com/cortezaproject/corteza-server/store/postgres"
|
||||
@@ -38,6 +39,8 @@ func Test_Store(t *testing.T) {
|
||||
}
|
||||
)
|
||||
|
||||
logger.Init()
|
||||
|
||||
var (
|
||||
ctx = context.Background()
|
||||
|
||||
@@ -88,8 +91,6 @@ func Test_Store(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
t.Logf("connecting to %s with %s", s.name, dsn)
|
||||
|
||||
genericStore, err := s.init(ctx, dsn)
|
||||
if err != nil {
|
||||
t.Errorf("failed to initialize %s store: %s", s.name, err.Error())
|
||||
|
||||
Reference in New Issue
Block a user