Skip to content

Commit

Permalink
Update passing in alb endpoints to integ test
Browse files Browse the repository at this point in the history
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
  • Loading branch information
lewijacn committed Oct 24, 2024
1 parent 0b13f00 commit 4ef203d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ def pytest_addoption(parser):
parser.addoption("--stage", action="store", default="dev")
parser.addoption("--config_file_path", action="store", default="/etc/migration_services.yaml",
help="Path to config file for console library")

parser.addoption("--source_proxy_alb_endpoint", action="store", default=None,
help="Specify the Migration ALB endpoint for the source capture proxy")
parser.addoption("--target_proxy_alb_endpoint", action="store", default=None,
help="Specify the Migration ALB endpoint for the target proxy")

@pytest.fixture
def unique_id(pytestconfig):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ def initialize(request):
# If in AWS, modify source and target objects here to route requests through the created ALB to verify its operation
if 'AWS_EXECUTION_ENV' in os.environ:
logger.info("Detected an AWS environment")
stage = request.config.getoption("--stage")
source_proxy_alb_endpoint = request.config.getoption("--source_proxy_alb_endpoint")
target_proxy_alb_endpoint = request.config.getoption("--target_proxy_alb_endpoint")
logger.info("Checking original source and target endpoints can be reached, before using ALB endpoints for test")
direct_source_con_result: ConnectionResult = connection_check(source_cluster)
assert direct_source_con_result.connection_established is True
direct_target_con_result: ConnectionResult = connection_check(target_cluster)
assert direct_target_con_result.connection_established is True
source_cluster.endpoint = f"https://alb.migration.{stage}.local:9201"
target_cluster.endpoint = f"https://alb.migration.{stage}.local:9202"
source_cluster.endpoint = source_proxy_alb_endpoint
target_cluster.endpoint = target_proxy_alb_endpoint
target_cluster.allow_insecure = True
backfill: Backfill = pytest.console_env.backfill
assert backfill is not None
Expand Down
3 changes: 2 additions & 1 deletion vars/defaultIntegPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ def call(Map config = [:]) {
def time = new Date().getTime()
def uniqueId = "integ_min_${time}_${currentBuild.number}"
def test_result_file = "${testDir}/reports/${uniqueId}/report.xml"
def populatedIntegTestCommand = integTestCommand.replaceAll("<STAGE>", stage)
def command = "pipenv run pytest --log-file=${testDir}/reports/${uniqueId}/pytest.log " +
"--junitxml=${test_result_file} ${integTestCommand} " +
"--junitxml=${test_result_file} ${populatedIntegTestCommand} " +
"--unique_id ${uniqueId} " +
"--stage ${stage} " +
"-s"
Expand Down
2 changes: 1 addition & 1 deletion vars/fullDefaultE2ETest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ def call(Map config = [:]) {
defaultStageId: 'full-integ',
skipCaptureProxyOnNodeSetup: true,
jobName: 'full-default-e2e-test',
integTestCommand: '/root/lib/integ_test/integ_test/full_tests.py'
integTestCommand: '/root/lib/integ_test/integ_test/full_tests.py --source_proxy_alb_endpoint https://alb.migration.<STAGE>.local:9201 --target_proxy_alb_endpoint https://alb.migration.<STAGE>.local:9202'
)
}

0 comments on commit 4ef203d

Please sign in to comment.