Modified tests to use tlogger. (#3343)

* Modified tests to use tlogger.

* Fail on errors, with error expectations.

* Added expects and MixedCapsed grpclb_config tests

* Moved tlogger to grpctest, moved leakcheck tester to grpctest.go

* Added ExpectErrorN()

* Removed redundant leak checks

* Fixed new test

* Made tlogger globals into tlogger methods

* ErrorsLeft -> EndTest

* Removed some redundant lines

* Fixed error in test and empty map in EndTest
This commit is contained in:
Garrett Gutierrez
2020-02-06 13:03:20 -08:00
committed by GitHub
parent cb03b9f65c
commit 132187f04c
77 changed files with 1036 additions and 614 deletions

View File

@ -28,8 +28,17 @@ import (
"github.com/golang/protobuf/proto"
helloworld "google.golang.org/grpc/examples/helloworld/helloworld"
hwmock "google.golang.org/grpc/examples/helloworld/mock_helloworld"
"google.golang.org/grpc/internal/grpctest"
)
type s struct {
grpctest.Tester
}
func Test(t *testing.T) {
grpctest.RunSubTests(t, s{})
}
// rpcMsg implements the gomock.Matcher interface
type rpcMsg struct {
msg proto.Message
@ -47,7 +56,7 @@ func (r *rpcMsg) String() string {
return fmt.Sprintf("is %s", r.msg)
}
func TestSayHello(t *testing.T) {
func (s) TestSayHello(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockGreeterClient := hwmock.NewMockGreeterClient(ctrl)