Skip to content

Commit

Permalink
consolidate TestNoLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
ploxiln committed May 22, 2017
1 parent 245d65d commit f66b3f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
8 changes: 8 additions & 0 deletions internal/lg/lg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@ func TestLogging(t *testing.T) {
}
test.Equal(t, 5, logger.Count)
}

func TestNoLogger(t *testing.T) {
opts := newOptions()
opts.Logger = NilLogger{}
app := newApp(opts)

app.logf(ERROR, "should never be logged")
}
10 changes: 0 additions & 10 deletions nsqadmin/nsqadmin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ import (
"github.com/nsqio/nsq/nsqd"
)

func TestNoLogger(t *testing.T) {
opts := NewOptions()
opts.Logger = lg.NilLogger{}
opts.HTTPAddress = "127.0.0.1:0"
opts.NSQLookupdHTTPAddresses = []string{"127.0.0.1:4161"}
nsqadmin := New(opts)

nsqadmin.logf(LOG_ERROR, "should never be logged")
}

func TestNeitherNSQDAndNSQLookup(t *testing.T) {
if os.Getenv("BE_CRASHER") == "1" {
opts := NewOptions()
Expand Down
10 changes: 0 additions & 10 deletions nsqlookupd/nsqlookupd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ func identify(t *testing.T, conn net.Conn) {
test.Nil(t, err)
}

func TestNoLogger(t *testing.T) {
opts := NewOptions()
opts.Logger = lg.NilLogger{}
opts.TCPAddress = "127.0.0.1:0"
opts.HTTPAddress = "127.0.0.1:0"
nsqlookupd := New(opts)

nsqlookupd.logf(LOG_FATAL, "should never be logged")
}

func TestBasicLookupd(t *testing.T) {
opts := NewOptions()
opts.Logger = test.NewTestLogger(t)
Expand Down

0 comments on commit f66b3f7

Please sign in to comment.