Skip to content

Commit

Permalink
Add noplogger to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mhartenbower committed Oct 13, 2019
1 parent c710b85 commit 121af1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ package main
import (
"reflect"
"testing"

"github.com/go-kit/kit/log"
)

func TestHandlePacket(t *testing.T) {
Expand Down Expand Up @@ -413,7 +415,7 @@ func TestHandlePacket(t *testing.T) {
},
}

for k, l := range []statsDPacketHandler{&StatsDUDPListener{}, &mockStatsDTCPListener{}} {
for k, l := range []statsDPacketHandler{&StatsDUDPListener{nil, nil, log.NewNopLogger()}, &mockStatsDTCPListener{StatsDTCPListener{nil, nil, log.NewNopLogger()}, log.NewNopLogger()}} {
events := make(chan Events, 32)
l.SetEventHandler(&unbufferedEventHandler{c: events})
for i, scenario := range scenarios {
Expand Down
3 changes: 2 additions & 1 deletion exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func TestInvalidUtf8InDatadogTagValue(t *testing.T) {
ueh := &unbufferedEventHandler{c: events}

go func() {
for _, l := range []statsDPacketHandler{&StatsDUDPListener{}, &mockStatsDTCPListener{}} {
for _, l := range []statsDPacketHandler{&StatsDUDPListener{nil, nil, log.NewNopLogger()}, &mockStatsDTCPListener{StatsDTCPListener{nil, nil, log.NewNopLogger()}, log.NewNopLogger()}} {
l.SetEventHandler(ueh)
l.handlePacket([]byte("bar:200|c|#tag:value\nbar:200|c|#tag:\xc3\x28invalid"))
}
Expand Down Expand Up @@ -648,6 +648,7 @@ type statsDPacketHandler interface {

type mockStatsDTCPListener struct {
StatsDTCPListener
log.Logger
}

func (ml *mockStatsDTCPListener) handlePacket(packet []byte) {
Expand Down

0 comments on commit 121af1d

Please sign in to comment.