QDB-16632 - Automatically detect whether encryption is enabled or not for the Python tests#94
Merged
igorniebylski merged 2 commits intomasterfrom May 7, 2025
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the test suite to automatically detect whether encryption is enabled by replacing hard-coded True values with a dynamic retrieval from the test settings.
- Updated tests to use qdbd_settings["security"]["enable_encryption"] instead of a hard-coded value
- Updated the settings in conftest.py to derive the encryption flag from an environment variable
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_stats.py | Replaces hard-coded True with settings-based encryption flag |
| tests/test_node.py | Consistently retrieves enable_encryption from test settings |
| tests/test_connection.py | Applies the same dynamic encryption configuration in connection tests |
| tests/conftest.py | Introduces the environment variable QDB_ENCRYPT_TRAFFIC for encryption flag |
| user_private_key=qdbd_settings.get("security").get("user_private_key"), | ||
| cluster_public_key=qdbd_settings.get("security").get("cluster_public_key"), | ||
| enable_encryption=True, | ||
| enable_encryption=qdbd_settings.get("security").get("enable_encryption"), |
There was a problem hiding this comment.
[nitpick] Consider defining a fixture or local variable to retrieve the encryption flag once, rather than repeating qdbd_settings.get("security").get("enable_encryption") in multiple tests.
solatis
approved these changes
May 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Story details: https://app.shortcut.com/quasardb/story/16632