Repository navigation
Testing PubsubService #42
Description
Activity
Having your contribution would be awesome!
I agree that using a local implementation for PubSub (such as the gcd.sh for Datastore) for testing would be great but this should be decided by someone from the service (I will make sure they respond to this issue). If you were planning to write such tool in Java then, as you suggested, you can create a c.g.gcloud.spi.PubsubRpc version for testing that delegates to it directly (until its available as an external process).This is great! Here is my opinion. Since the local emulator can be an independent server process, it will benefit users of other languages. In that sense I think the emulator should live somewhere else other than gcloud-java. Ideally it should become a sub component of gcloud sdk (Google Cloud SDK).
@psakkaris @aozarov WDYT?
Thanks for the feedback! Yes gcloud sdk seems the most appropriate place for a pubsub emulator. gcloud sdk is also open source correct? I found this https://code.google.com/p/google-cloud-sdk/
Even if the cloud-sdk code is under Apache 2.0, I don't think there is a public repository for you to contribute to atm. /cc @skelterjohn
I would suggest to start a repository independent from the cloud-sdk, recommends its usage from the various
gcloud-repo once it is tested, and work into including it into the gcloud distribution as a separate effort.@proppy Yup, that sounds right to me. Thanks!
ok sounds good!
There is an issue at the Official Google Cloud Pub/Sub feature request and issue tracker. The best way to let the team know you are interested in this feature is to vote for it by starring the issue.
@psakkaris How are the things going with PubsubRpc?
For the tests for PubsubRpc, I would just use mocks.@aozarov WDYT?
Also if you want to have integration tests, you can even use the actual cloud project for testing purpose. I can setup the billing whitelisted project, a service account, and the travis configuration for the service account key.
Yes, I think using mocks as an interim solution for unit-tests until local
service is available should be fine.On Wed, May 6, 2015 at 10:50 AM, Takashi Matsuo notifications@github.com
wrote:@psakkaris https://github.com/psakkaris How are the things going with
PubsubRpc?
For the tests for PubsubRpc, I would just use mocks.@aozarov https://github.com/aozarov WDYT?
—
Reply to this email directly or view it on GitHub
#42 (comment)
.Hey guys, PubsubRpc is implemented and checked in on my fork. I am now moving on to the higher level PubsubService. I'll just use mocks for the unit testing. If all goes as planned I should have everything in with example documentation by end of month.
Thank is great news! Thank you for your contribution and let me know when
you things are ready for review.
Arie.On Fri, May 8, 2015 at 2:13 PM, Periklis (Perry) Sakkaris <notifications@
github.com> wrote:Hey guys, PubsubRpc is implemented and checked in on my fork. I am now
moving on to the higher level PubsubService. I'll just use mocks for the
unit testing. If all goes as planned I should have everything in with
example documentation by end of month.—
Reply to this email directly or view it on GitHub
#42 (comment)
.@psakkaris any updates?
- added a commit that references this issue
on Mar 29, 2016 Closing this, support for Pub/Sub using gRPC was added in #1085
10 remaining items
- added a commit that references this issue
on Sep 15, 2022 - added 9 commits that reference this issue
on Sep 30, 2022 - added a commit that references this issue
on Dec 22, 2025 - added a commit that references this issue
on Jan 22, 2026 - added a commit that references this issue
on Mar 11, 2026 - added a commit that references this issue
on Mar 23, 2026 - added a commit that references this issue
on Jul 13, 2026
I would like to contribute to this project by helping out on the Pubsub feature. I forked the repo and implemented a PubsubRpc client. I will now move on to create a PubsubService and Examples with documentation. But, I have a question with testing:
To unit test I can make a mock PubsubRpc client that simulates response json from the rest api, however, I was thinking a better way could be to have a Pubsub emulation available as a local development environment like the Datastore local dev server. I know as a user of GCP that would make my life much easier for testing things out. So not only do we get a good unit testing mechanism, but it will be a valuable tool for developers in general. What are your thoughts on this functionality, and if I decide to add this local dev pubsub environment, do you think it belongs in gcloud-java or somewhere else?