-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andre Kurait <[email protected]>
- Loading branch information
1 parent
77813d1
commit be19bc3
Showing
7 changed files
with
35 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
35 changes: 35 additions & 0 deletions
35
...icCapture/dockerSolution/src/main/docker/migrationConsole/cluster_tools/tests/conftest.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
import tempfile | ||
import yaml | ||
import pytest | ||
from testcontainers.opensearch import OpenSearchContainer | ||
from testcontainers.core.waiting_utils import wait_for_logs | ||
from console_link.environment import Environment | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def env(): | ||
# Spin up the OpenSearch container and wait until it's healthy | ||
container = OpenSearchContainer() | ||
container.start() | ||
wait_for_logs(container, ".*recovered .* indices into cluster_state.*") | ||
|
||
base_url = f"http://{container.get_container_host_ip()}:{container.get_exposed_port(9200)}" | ||
# Create a temporary services.yaml file based on the services.yaml spec | ||
services_config = { | ||
'target_cluster': { | ||
'endpoint': base_url, | ||
'allow_insecure': True, | ||
'no_auth': {} | ||
} | ||
} | ||
|
||
with tempfile.NamedTemporaryFile(mode='w', delete=False) as temp_config: | ||
yaml.dump(services_config, temp_config) | ||
temp_config_path = temp_config.name | ||
|
||
yield Environment(temp_config_path) | ||
|
||
# Stop the container and clean up the temporary services.yaml file after tests complete | ||
container.stop() | ||
os.remove(temp_config_path) |
1 change: 0 additions & 1 deletion
1
.../dockerSolution/src/main/docker/migrationConsole/cluster_tools/tests/create_index_test.py
This file contains 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
1 change: 0 additions & 1 deletion
1
...n/src/main/docker/migrationConsole/cluster_tools/tests/disable_compatibility_mode_test.py
This file contains 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
1 change: 0 additions & 1 deletion
1
...on/src/main/docker/migrationConsole/cluster_tools/tests/enable_compatibility_mode_test.py
This file contains 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
This file contains 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
34 changes: 0 additions & 34 deletions
34
TrafficCapture/dockerSolution/src/main/docker/migrationConsole/cluster_tools/tests/utils.py
This file contains 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