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

received unexpected error: zk: could not find testing zookeeper bin path at "zookeeper/bin": CreateFile zookeeper/bin: The system cannot find the path specified. #120

Open
chunxue-ding opened this issue Feb 2, 2024 · 3 comments

Comments

@chunxue-ding
Copy link

I pull down the code for the master branch ,and run the zk_test test file,The function method is TestIntegration_Create ,Then an error was reported,Debugging indicates that an error occurs in the StartTestCluster method . error message is received unexpected error: zk: could not find testing zookeeper bin path at "zookeeper/bin": CreateFile zookeeper/bin: The system cannot find the path specified.

@chunxue-ding
Copy link
Author

chunxue-ding commented Feb 2, 2024

Do I need to install zk in my local environment ?

@jeffbean
Copy link

jeffbean commented Feb 5, 2024

Currently there are two classes of tests in the library; unit tests, and integrations tests.

Any test case with the work Integration assumes a local zookeeper setup. What we have currently done is wrapped this in the Makefile.

To run all the non-integration tests we can run make unittest to run pure Go tests without needing any external dependencies.

make test will download and setup the required zookeeper binaries to run the integration tests.

The PR process will expect all tests to pass, including the Integration ones.

Another way if you are using an Editor or IDE that runs tests on save, you can have the go test flags exclude these tests with -skip=Integration as a flag to go test.

@chunxue-ding
Copy link
Author

Thank you for your reply,Because I'm testing a function method in a local environment that calls a zk query method, and the client creation of the zk is inside the zk query method, not outside the zk query method and passed in as an argument, this causes me to mock out a virtual ZK client when I do the unit test of the function method. Because this is possible for etcd before, would you like to know if there is a similar method for zk

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

2 participants