Skip to content

Commit

Permalink
Fix the broken integrationt test (#48)
Browse files Browse the repository at this point in the history
The #47 move zap
into its own packge but it also breaks the integration test.
This change is to fix integ test by correcting its package
reference.

Signed-off-by: Tao Jiang <[email protected]>
  • Loading branch information
Tao Jiang authored Nov 4, 2019
1 parent 5756109 commit b6c74c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions test/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"testing"

"github.com/vmware/vmware-go-kcl/logger"
zaplogger "github.com/vmware/vmware-go-kcl/logger/zap"
)

func TestZapLoggerWithConfig(t *testing.T) {
Expand All @@ -41,7 +42,7 @@ func TestZapLoggerWithConfig(t *testing.T) {
Filename: "log.log",
}

log := logger.NewZapLoggerWithConfig(config)
log := zaplogger.NewZapLoggerWithConfig(config)

contextLogger := log.WithFields(logger.Fields{"key1": "value1"})
contextLogger.Debugf("Starting with zap")
Expand All @@ -52,7 +53,7 @@ func TestZapLogger(t *testing.T) {
zapLogger, err := zap.NewProduction()
assert.Nil(t, err)

log := logger.NewZapLogger(zapLogger.Sugar())
log := zaplogger.NewZapLogger(zapLogger.Sugar())

contextLogger := log.WithFields(logger.Fields{"key1": "value1"})
contextLogger.Debugf("Starting with zap")
Expand Down
5 changes: 3 additions & 2 deletions test/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/vmware/vmware-go-kcl/clientlibrary/utils"
wk "github.com/vmware/vmware-go-kcl/clientlibrary/worker"
"github.com/vmware/vmware-go-kcl/logger"
zaplogger "github.com/vmware/vmware-go-kcl/logger/zap"
)

const (
Expand Down Expand Up @@ -109,7 +110,7 @@ func TestWorkerWithSigInt(t *testing.T) {
// At miminal. use standard zap logger
//zapLogger, err := zap.NewProduction()
//assert.Nil(t, err)
//log := logger.NewZapLogger(zapLogger.Sugar())
//log := zaplogger.NewZapLogger(zapLogger.Sugar())
//
// In order to have precise control over logging. Use logger with config.
config := logger.Configuration{
Expand All @@ -122,7 +123,7 @@ func TestWorkerWithSigInt(t *testing.T) {
Filename: "log.log",
}
// use zap logger
log := logger.NewZapLoggerWithConfig(config)
log := zaplogger.NewZapLoggerWithConfig(config)

kclConfig := cfg.NewKinesisClientLibConfig("appName", streamName, regionName, workerID).
WithInitialPositionInStream(cfg.LATEST).
Expand Down

0 comments on commit b6c74c3

Please sign in to comment.