-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add endpoints and authentication details (including SigV4) as parameters to E2E test script #461
Changes from 1 commit
edcda15
79b0b84
bd3ab8e
e16999a
6d59979
c009947
2930a32
f721399
ae0e482
8e2a3c6
cb13a85
c7c1da3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,4 @@ jobs: | |
run: | | ||
cd test | ||
chmod +x ./tests.py | ||
pytest tests.py | ||
pytest tests.py --unique_id="testindex" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
import logging | ||
import time | ||
import requests | ||
import uuid | ||
import string | ||
import secrets | ||
import pytest | ||
|
@@ -76,7 +75,7 @@ class E2ETests(unittest.TestCase): | |
@pytest.fixture(autouse=True) | ||
def init_fixtures(self, proxy_endpoint, source_endpoint, target_endpoint, source_auth_type, source_username, | ||
source_password, target_auth_type, target_username, target_password, target_verify_ssl, | ||
source_verify_ssl): | ||
source_verify_ssl, deployment_type, unique_id): | ||
self.proxy_endpoint = proxy_endpoint | ||
self.source_endpoint = source_endpoint | ||
self.target_endpoint = target_endpoint | ||
|
@@ -90,6 +89,8 @@ def init_fixtures(self, proxy_endpoint, source_endpoint, target_endpoint, source | |
self.target_password = target_password | ||
self.source_verify_ssl = source_verify_ssl.lower() == 'true' | ||
self.target_verify_ssl = target_verify_ssl.lower() == 'true' | ||
self.deployment_type = deployment_type | ||
self.unique_id = unique_id | ||
|
||
def setup_authentication(self, auth_type, username, password): | ||
if auth_type == "basic": | ||
|
@@ -103,7 +104,7 @@ def setup_authentication(self, auth_type, username, password): | |
return None | ||
|
||
def set_common_values(self): | ||
self.index = f"my_index_{uuid.uuid4()}" | ||
self.index = self.unique_id | ||
self.doc_id = '7' | ||
self.ignore_list = [] | ||
|
||
|
@@ -264,16 +265,22 @@ def test_0005_invalidIncorrectUri(self): | |
self.assertEqual(response.status_code, HTTPStatus.METHOD_NOT_ALLOWED) | ||
|
||
def test_0006_OSB(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like it will need to be tweaked to work for AWS as well. For AWS we will already be on the migration console box so we would just need to make the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, this specific test won't work on AWS as of this moment. I imagined that this script will end up existing on the migration console and running from there. I can update this test in a future PR to support that. |
||
cmd = ['docker', 'ps', '--format="{{.ID}}"', '--filter', 'name=migration'] | ||
container_id = subprocess.run(cmd, stdout=subprocess.PIPE, text=True).stdout.strip().replace('"', '') | ||
|
||
if container_id: | ||
cmd_exec = f"docker exec {container_id} ./runTestBenchmarks.sh" | ||
logger.warning(f"Running command: {cmd_exec}") | ||
if self.deployment_type == "cloud": | ||
cmd_exec = f"./runTestBenchmarks --unique-id {self.index}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The path here for runTestBenchmarks will be in a different directory. It's probably easiest to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we also use the self.unique_id instead of self.index here? It seems like it may be clearer There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, I'll update in the next commit. |
||
logger.warning(f"Running local command: {cmd_exec}") | ||
subprocess.run(cmd_exec, shell=True) | ||
else: | ||
logger.error("Migration-console container was not found, please double check that deployment was a success") | ||
self.assert_(False) | ||
cmd = ['docker', 'ps', '--format="{{.ID}}"', '--filter', 'name=migration'] | ||
container_id = subprocess.run(cmd, stdout=subprocess.PIPE, text=True).stdout.strip().replace('"', '') | ||
|
||
if container_id: | ||
cmd_exec = f"docker exec {container_id} ./runTestBenchmarks.sh" | ||
logger.warning(f"Running command: {cmd_exec}") | ||
subprocess.run(cmd_exec, shell=True) | ||
else: | ||
logger.error("Migration-console container was not found," | ||
" please double check that deployment was a success") | ||
self.assert_(False) | ||
|
||
source_indices = get_indices(self.source_endpoint, self.source_auth, self.source_verify_ssl) | ||
target_indices = get_indices(self.target_endpoint, self.target_auth, self.target_verify_ssl) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like it would be nice to keep the previous format like:
f"test_index_{self.unique_id}"
to be able to clearly tell what our test index isThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine our unique id for the integ tests may just be the name of the test and the pipeline run number like
full_run_21