Skip to content

Commit

Permalink
Remove an argument from AssertRelayStats
Browse files Browse the repository at this point in the history
The test server itself implements `testing.TB`, so there's no need for
the caller to pass one into `AssertRelayStats`.
  • Loading branch information
Akshay Shah committed Jun 10, 2016
1 parent 9f7c406 commit ef1d671
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions relay_test.go
Expand Up @@ -60,7 +60,7 @@ func TestRelay(t *testing.T) {
for _ = range tests {
calls.Add("client", "test", "echo").Succeeded().End()
}
ts.AssertRelayStats(t, calls)
ts.AssertRelayStats(calls)
})
}

Expand Down Expand Up @@ -102,7 +102,7 @@ func TestRelayConnectionCloseDrainsRelayItems(t *testing.T) {

calls := relay.NewMockStats()
calls.Add("s2", "s1", "echo").Succeeded().End()
ts.AssertRelayStats(t, calls)
ts.AssertRelayStats(calls)
})
}

Expand Down Expand Up @@ -156,7 +156,7 @@ func TestRelayErrorUnknownPeer(t *testing.T) {

calls := relay.NewMockStats()
calls.Add(client.PeerInfo().ServiceName, "random-service", "echo").Failed("relay-declined").End()
ts.AssertRelayStats(t, calls)
ts.AssertRelayStats(calls)
})
}

Expand All @@ -180,7 +180,7 @@ func TestErrorFrameEndsRelay(t *testing.T) {

calls := relay.NewMockStats()
calls.Add(client.PeerInfo().ServiceName, "svc", "echo").Failed("bad-request").End()
ts.AssertRelayStats(t, calls)
ts.AssertRelayStats(calls)
})
}

Expand Down
4 changes: 2 additions & 2 deletions testutils/test_server.go
Expand Up @@ -181,11 +181,11 @@ func (ts *TestServer) CloseAndVerify() {

// AssertRelayStats checks that the relayed call graph matches expectations. If
// there's no relay, AssertRelayStats is a no-op.
func (ts *TestServer) AssertRelayStats(t testing.TB, expected *relay.MockStats) {
func (ts *TestServer) AssertRelayStats(expected *relay.MockStats) {
if !ts.HasRelay() {
return
}
ts.relayStats.AssertEqual(t, expected)
ts.relayStats.AssertEqual(ts, expected)
}

// NewClient returns a client that with log verification.
Expand Down

0 comments on commit ef1d671

Please sign in to comment.