Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mocks] Add Mock Server Implementation #1166

Open
jayshrivastava opened this issue Jan 31, 2024 · 3 comments
Open

[Mocks] Add Mock Server Implementation #1166

jayshrivastava opened this issue Jan 31, 2024 · 3 comments

Comments

@jayshrivastava
Copy link
Contributor

jayshrivastava commented Jan 31, 2024

Is your feature request related to a problem? Please describe.
I would like to unit test this library, but there is no mock server implementation. Testing requires me to start a standalone pulsar server and emit to it.

Describe the solution you'd like
I would like to be able to write unit tests without starting up a pulsar server. I want to ensure the server receives messages in the right order

@crossoverJie
Copy link
Member

If we provide a Make command to run a docker standalone pulsar service locally, will the problem be solved?

@jayshrivastava
Copy link
Contributor Author

jayshrivastava commented Mar 12, 2024

@crossoverJie I think this is not great because it would make our unit tests more expensive to run. In the google pubsub sdk, there's go/pkg/mod/cloud.google.com/go/[email protected]/pstest/fake.go a mock server which can be injected https://github.com/cockroachdb/cockroach/blob/47106211a8b522610adf05465f095c124a3d33a2/pkg/ccl/changefeedccl/testfeed_test.go#L2305-L2308

@geniusjoe
Copy link
Contributor

Pulsar broker and bookie is written in Java. And I think it will be a little complicated if we mock broker code in the unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants