You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "damondouglas (via GitHub)" <gi...@apache.org> on 2023/02/21 18:16:29 UTC

[GitHub] [beam] damondouglas commented on pull request #24946: [Playground] Resolve issue with SCIO examples failing on start due to a timeout

damondouglas commented on PR #24946:
URL: https://github.com/apache/beam/pull/24946#issuecomment-1438910092

   > I looked into this errors, seems that there should be additional measures taken to make tests runnable in Cloud Shell environment.
   
   FYI this was a compute engine instance but nonetheless a clean environment.
   
   > I [updated](https://github.com/apache/beam/blob/c8900dfa2a04c76ca538535bdb2e355d001ccc64/playground/backend/README.md#prerequisite) Readme to clarify that tests need local Datastore emulator to run and they will not run with real datastore (although this should be easily fixable - but I'm not if this change worth the effort).
   
   Instead of the emulator, have you tried to:
   1. Implement a mock [google.golang.org/genproto/googleapis/datastore/v1](https://pkg.go.dev/google.golang.org/genproto/googleapis/datastore/v1#DatastoreServer) with only the endpoints needed for the tests?  Endpoints not needed could simply return fmt.Errorf("not implemted")
   2.  In your test you can add https://pkg.go.dev/google.golang.org/api/option#WithEndpoint to the https://pkg.go.dev/google.golang.org/api/option#WithEndpoint after service begins
   3. When test(s) complete, shut down the service
   
   If you still want to use the emulator, I recommend the tests that need it to actually activate and shut down the emulator but personally when I test Google api dependent code in the context of Go, I implement the grpc server.  This doesn't replace integration tests but serves as a quicker way to detect errors in code.
   


-- 
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