Skip to content

Adapt Tests to Allow External Server Connections #7

Merged
KarthikSubbarao merged 20 commits into
valkey-io:unstablefrom
Nikhil-Manglore:exteranl_test_additions
Aug 12, 2025
Merged

Adapt Tests to Allow External Server Connections #7
KarthikSubbarao merged 20 commits into
valkey-io:unstablefrom
Nikhil-Manglore:exteranl_test_additions

Conversation

@Nikhil-Manglore
Copy link
Copy Markdown
Member

@Nikhil-Manglore Nikhil-Manglore commented Aug 4, 2025

Updating the valkey-test-framework to accept connections from external servers as opposed to always starting a new server

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>
Comment thread src/valkey_test_case.py Outdated
Comment thread src/valkey_test_case.py Outdated
Comment thread src/valkey_test_case.py Outdated
Comment thread src/valkey_test_case.py
@zackcam
Copy link
Copy Markdown
Collaborator

zackcam commented Aug 6, 2025

Just question in general, I assume you used this in JSON module, did you try the rdb load for that module with external?

Comment thread src/valkey_test_case.py Outdated
Comment thread src/valkey_test_case.py Outdated
Test for connecting to a external Valkey server
"""

def setup_docker_server(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, this itself should be a utility function in the framework. You can consider this in the future

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense will do it in the future

Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Comment thread src/valkey_test_case.py
Comment thread src/valkey_test_case.py
Comment thread src/valkey_test_case.py Outdated
Comment thread src/valkey_test_case.py Outdated
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Comment thread src/valkey_test_case.py
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Comment thread src/valkey_test_case.py Outdated
Comment thread src/valkey_test_case.py
self.client.close()
self.client = None

# No server process to clean up if we're using an external server
Copy link
Copy Markdown
Member

@KarthikSubbarao KarthikSubbarao Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Is external_mode supposed 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 the restart function. It would be better to move the docker commands outside the test framework and into the test.

  2. Is external_mode supposed to be a way for test developers to run tests against docker specifically? If so, we can implement the startup, restart, and exit methods to execute docker commands in a controllable way (ie - controlling the port, etc).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Nikhil-Manglore and others added 2 commits August 11, 2025 01:56
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nikhilmanglore9@gmail.com>
Comment thread src/valkey_test_case.py
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
Comment thread src/valkey_test_case.py Outdated
Signed-off-by: Nikhil Manglore <nmanglor@amazon.com>
@KarthikSubbarao KarthikSubbarao merged commit 57ce589 into valkey-io:unstable Aug 12, 2025
3 checks passed
@Nikhil-Manglore Nikhil-Manglore deleted the exteranl_test_additions branch August 14, 2025 21:29
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

Successfully merging this pull request may close these issues.

3 participants