Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
acha-bill committed Mar 18, 2024
1 parent bc051ea commit d39fba8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pkg/log/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func TestPretty(t *testing.T) {
exp: `{"Inner":"I am a log.Marshaler"}`,
}, {
val: (*marshalerTest)(nil),
exp: `"<panic: value method github.com/ethersphere/bee/pkg/log.marshalerTest.MarshalLog called using nil *marshalerTest pointer>"`,
exp: `"<panic: value method github.com/ethersphere/bee/v2/pkg/log.marshalerTest.MarshalLog called using nil *marshalerTest pointer>"`,
}, {
val: marshalerPanicTest{"foobar"},
exp: `"<panic: marshalerPanicTest>"`,
Expand All @@ -395,7 +395,7 @@ func TestPretty(t *testing.T) {
exp: `"I am a fmt.Stringer"`,
}, {
val: (*stringerTest)(nil),
exp: `"<panic: value method github.com/ethersphere/bee/pkg/log.stringerTest.String called using nil *stringerTest pointer>"`,
exp: `"<panic: value method github.com/ethersphere/bee/v2/pkg/log.stringerTest.String called using nil *stringerTest pointer>"`,
}, {
val: stringerPanicTest{"foobar"},
exp: `"<panic: stringerPanicTest>"`,
Expand All @@ -407,7 +407,7 @@ func TestPretty(t *testing.T) {
exp: `"I am an error"`,
}, {
val: (*errorTest)(nil),
exp: `"<panic: value method github.com/ethersphere/bee/pkg/log.errorTest.Error called using nil *errorTest pointer>"`,
exp: `"<panic: value method github.com/ethersphere/bee/v2/pkg/log.errorTest.Error called using nil *errorTest pointer>"`,
}, {
val: errorPanicTest{"foobar"},
exp: `"<panic: errorPanicTest>"`,
Expand Down
2 changes: 1 addition & 1 deletion pkg/log/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func TestLoggerWithCaller(t *testing.T) {
}
})
t.Run("caller=CategoryAll, logCallerFunc=true", func(t *testing.T) {
const thisFunc = "github.com/ethersphere/bee/pkg/log.TestLoggerWithCaller.func3"
const thisFunc = "github.com/ethersphere/bee/v2/pkg/log.TestLoggerWithCaller.func3"

logger, bb := newLogger(WithCaller(CategoryAll), WithCallerFunc())

Expand Down
2 changes: 1 addition & 1 deletion pkg/p2p/protobuf/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ func TestMain(m *testing.M) {
goleak.IgnoreTopFunction("time.Sleep"),
goleak.IgnoreTopFunction("io.(*pipe).read"),
goleak.IgnoreTopFunction("io.(*pipe).write"),
goleak.IgnoreTopFunction("github.com/ethersphere/bee/pkg/p2p/protobuf_test.newMessageWriter.func1"),
goleak.IgnoreTopFunction("github.com/ethersphere/bee/v2/pkg/p2p/protobuf_test.newMessageWriter.func1"),
)
}
4 changes: 2 additions & 2 deletions pkg/retrieval/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestMain(m *testing.M) {
goleak.VerifyTestMain(
m,
// pkg/p2p package has some leak issues, we ignore them here as they are not in current scope
goleak.IgnoreTopFunction("github.com/ethersphere/bee/pkg/p2p/protobuf.Reader.ReadMsgWithContext"),
goleak.IgnoreTopFunction("github.com/ethersphere/bee/pkg/p2p/streamtest.(*record).Read"),
goleak.IgnoreTopFunction("github.com/ethersphere/bee/v2/pkg/p2p/protobuf.Reader.ReadMsgWithContext"),
goleak.IgnoreTopFunction("github.com/ethersphere/bee/v2/pkg/p2p/streamtest.(*record).Read"),
)
}

0 comments on commit d39fba8

Please sign in to comment.