You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/03/04 17:25:00 UTC
[GitHub] [beam] riteshghorse commented on a change in pull request #17014: [BEAM-13909] improve coverage of Provision package
riteshghorse commented on a change in pull request #17014:
URL: https://github.com/apache/beam/pull/17014#discussion_r819768183
##########
File path: sdks/go/pkg/beam/provision/provision_test.go
##########
@@ -52,3 +58,37 @@ func TestConversions(t *testing.T) {
}
}
}
+
+type ProvisionServiceServicer struct {
+ fnpb.UnimplementedProvisionServiceServer
+}
+
+func (p ProvisionServiceServicer) GetProvisionInfo(ctx context.Context, req *fnpb.GetProvisionInfoRequest) (*fnpb.GetProvisionInfoResponse, error) {
+ return &fnpb.GetProvisionInfoResponse{Info: &fnpb.ProvisionInfo{RetrievalToken: "token"}}, nil
+}
+
+func setup(addr string, prs *ProvisionServiceServicer) {
+ l, err := net.Listen("tcp", addr)
+ if err != nil {
+ log.Fatalf("failed to listen on addr: %v", err)
+ }
+ server := grpc.NewServer()
+ defer server.Stop()
+ fnpb.RegisterProvisionServiceServer(server, prs)
+ if err := server.Serve(l); err != nil {
+ log.Fatalf("cannot serve the server: %v", err)
+ }
+}
+
+func TestProvisionInfo(t *testing.T) {
+ prs := &ProvisionServiceServicer{}
+ go setup(":9000", prs)
Review comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org