Adapt Tests to Allow External Server Connections #7
Conversation
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
|
Just question in general, I assume you used this in JSON module, did you try the rdb load for that module with external? |
| Test for connecting to a external Valkey server | ||
| """ | ||
|
|
||
| def setup_docker_server(self): |
There was a problem hiding this comment.
Ideally, this itself should be a utility function in the framework. You can consider this in the future
There was a problem hiding this comment.
Makes sense will do it in the future
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
| self.client.close() | ||
| self.client = None | ||
|
|
||
| # No server process to clean up if we're using an external server |
There was a problem hiding this comment.
Looks like exit and startup methods are implemented by the test case itself where it runs the docker commands. But restart is the only function in the test framework which executes the docker commands.
Why do we split the code between the test and framework this way? It makes external_mode hard to use.
It would be nice if all the 3 docker commands are executed inside the test framework OR all 3 commands are executed by the test itself. Having some functionalities implemented by the test framework and some by the test is not a great approach IMO
Questions:
-
Is
external_modesupposed to be a way for test developers to run tests against any server (not just docker)? If so, we should not be running docker commands in therestartfunction. It would be better to move the docker commands outside the test framework and into the test. -
Is
external_modesupposed to be a way for test developers to run tests against docker specifically? If so, we can implement thestartup,restart, andexitmethods to execute docker commands in a controllable way (ie - controlling the port, etc).
There was a problem hiding this comment.
That makes sense. I think keeping external_mode available to best used for any server is a good idea, even though docker is the most likely. So i'll move the docker commands outside the test framework and into the test.
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nikhilmanglore9@gmail.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Updating the valkey-test-framework to accept connections from external servers as opposed to always starting a new server