3
0

RDBMS cleanup, init logger in store tests

This commit is contained in:
Denis Arh
2020-09-15 15:47:01 +02:00
parent 7af6218de9
commit 52b8f44d6c
3 changed files with 8 additions and 5 deletions

View File

@@ -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
//

View File

@@ -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
}

View File

@@ -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())