Skip to content

Commit

Permalink
test changes
Browse files Browse the repository at this point in the history
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
  • Loading branch information
coleenquadros committed Sep 5, 2023
1 parent e7586b7 commit 95849e2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions interceptors/logging/interceptors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,12 +654,12 @@ func TestCustomGrpcLogFieldsSuite(t *testing.T) {
},
}
s.InterceptorTestSuite.ClientOpts = []grpc.DialOption{
grpc.WithUnaryInterceptor(logging.UnaryClientInterceptor(s.logger, logging.WithLevels(customClientCodeToLevel), logging.WithGrpcLogFields(addGrpcLogFields))),
grpc.WithStreamInterceptor(logging.StreamClientInterceptor(s.logger, logging.WithLevels(customClientCodeToLevel), logging.WithGrpcLogFields(addGrpcLogFields))),
grpc.WithUnaryInterceptor(logging.UnaryClientInterceptor(s.logger, logging.WithGrpcLogFields(addGrpcLogFields))),
grpc.WithStreamInterceptor(logging.StreamClientInterceptor(s.logger, logging.WithGrpcLogFields(addGrpcLogFields))),
}
s.InterceptorTestSuite.ServerOpts = []grpc.ServerOption{
grpc.StreamInterceptor(logging.StreamServerInterceptor(s.logger, logging.WithLevels(customClientCodeToLevel), logging.WithGrpcLogFields(addGrpcLogFields))),
grpc.UnaryInterceptor(logging.UnaryServerInterceptor(s.logger, logging.WithLevels(customClientCodeToLevel), logging.WithGrpcLogFields(addGrpcLogFields))),
grpc.StreamInterceptor(logging.StreamServerInterceptor(s.logger, logging.WithGrpcLogFields(addGrpcLogFields))),
grpc.UnaryInterceptor(logging.UnaryServerInterceptor(s.logger, logging.WithGrpcLogFields(addGrpcLogFields))),
}
suite.Run(t, s)
}
Expand All @@ -684,7 +684,7 @@ func (s *loggingCustomGrpcLogFieldsSuite) TestCustomGrpcLogFieldsWithPing() {
AssertField(s.T(), logging.ServiceFieldKey, testpb.TestServiceFullName).AssertNoMoreTags(s.T())

serverStartCallLogLine := lines[3]
assert.Equal(s.T(), logging.LevelDebug, serverStartCallLogLine.lvl)
assert.Equal(s.T(), logging.LevelInfo, serverStartCallLogLine.lvl)
assert.Equal(s.T(), "started call", serverStartCallLogLine.msg)
serverStartCallFields := serverStartCallLogLine.fields
serverStartCallFields.AssertFieldNotEmpty(s.T(), "peer.address").
Expand All @@ -695,7 +695,7 @@ func (s *loggingCustomGrpcLogFieldsSuite) TestCustomGrpcLogFieldsWithPing() {
AssertField(s.T(), logging.ServiceFieldKey, testpb.TestServiceFullName).AssertNoMoreTags(s.T())

serverFinishCallLogLine := lines[0]
assert.Equal(s.T(), logging.LevelDebug, serverFinishCallLogLine.lvl)
assert.Equal(s.T(), logging.LevelInfo, serverFinishCallLogLine.lvl)
assert.Equal(s.T(), "finished call", serverFinishCallLogLine.msg)
serverFinishCallFields := serverFinishCallLogLine.fields
serverFinishCallFields.AssertFieldNotEmpty(s.T(), "peer.address").
Expand Down Expand Up @@ -744,7 +744,7 @@ func (s *loggingCustomGrpcLogFieldsSuite) TestCustomGrpcLogFieldsWithPingList()
AssertField(s.T(), logging.ServiceFieldKey, testpb.TestServiceFullName).AssertNoMoreTags(s.T())

serverStartCallLogLine := lines[3]
assert.Equal(s.T(), logging.LevelDebug, serverStartCallLogLine.lvl)
assert.Equal(s.T(), logging.LevelInfo, serverStartCallLogLine.lvl)
assert.Equal(s.T(), "started call", serverStartCallLogLine.msg)
serverStartCallFields := serverStartCallLogLine.fields
serverStartCallFields.AssertFieldNotEmpty(s.T(), "peer.address").
Expand All @@ -755,7 +755,7 @@ func (s *loggingCustomGrpcLogFieldsSuite) TestCustomGrpcLogFieldsWithPingList()
AssertField(s.T(), logging.ServiceFieldKey, testpb.TestServiceFullName).AssertNoMoreTags(s.T())

serverFinishCallLogLine := lines[0]
assert.Equal(s.T(), logging.LevelDebug, serverFinishCallLogLine.lvl)
assert.Equal(s.T(), logging.LevelInfo, serverFinishCallLogLine.lvl)
assert.Equal(s.T(), "finished call", serverFinishCallLogLine.msg)
serverFinishCallFields := serverFinishCallLogLine.fields
serverFinishCallFields.AssertFieldNotEmpty(s.T(), "peer.address").
Expand Down

0 comments on commit 95849e2

Please sign in to comment.