Skip to content

Commit

Permalink
Fix test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbrandhorst committed Feb 18, 2025
1 parent ecfff06 commit b0f6df1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ fmt: $(GOIMPORTS)

.PHONY: test
test:
@echo "Running tests for all modules: $(MODULES)"
$(MAKE) $(MODULES:%=test_module_%)

.PHONY: test_module_%
$(MODULES:%=test_module_%): test_module_%:
@echo "Running tests for dir: $*"
cd $* && go test -v -race ./...
go test ./...

.PHONY: deps
deps:
Expand Down
10 changes: 5 additions & 5 deletions interceptors/protovalidate/protovalidate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func startGrpcServer(t *testing.T, called *bool, ignoreMessages ...protoreflect.
lis := bufconn.Listen(bufSize)

validator, err := protovalidate.New()
assert.Nil(t, err)
require.Nil(t, err)

s := grpc.NewServer(
grpc.StreamInterceptor(
Expand All @@ -136,7 +136,7 @@ func startGrpcServer(t *testing.T, called *bool, ignoreMessages ...protoreflect.
}

conn, err := grpc.NewClient(
"bufnet",
"passthrough:///bufnet",
grpc.WithContextDialer(dialer),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
Expand All @@ -161,7 +161,7 @@ func TestStreamServerInterceptor(t *testing.T) {
)

out, err := client.SendStream(context.Background(), testvalidate.GoodStreamRequest)
assert.Nil(t, err)
require.Nil(t, err, "SendStream failed: %v", err)

_, err = out.Recv()
t.Log(err)
Expand All @@ -176,7 +176,7 @@ func TestStreamServerInterceptor(t *testing.T) {
)

out, err := client.SendStream(context.Background(), testvalidate.BadStreamRequest)
assert.Nil(t, err)
require.Nil(t, err, "SendStream failed: %v", err)

_, err = out.Recv()
assertEqualViolation(t, &validate.Violation{
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestStreamServerInterceptor(t *testing.T) {
)

out, err := client.SendStream(context.Background(), testvalidate.BadStreamRequest)
assert.Nil(t, err)
require.Nil(t, err, "SendStream failed: %v", err)

_, err = out.Recv()
assert.Nil(t, err)
Expand Down

0 comments on commit b0f6df1

Please sign in to comment.