Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tools/scripts/build-tests/run-al2-integ-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ AWS_ROLE_SESSION_NAME="$3"

echo "Setting the run environment"
export TEST_ASSUME_ROLE_ARN=arn:aws:iam::${AWS_ACCOUNT}:role/IntegrationTest
cd ${PREFIX_DIR}/aws-sdk-cpp
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: for this type of operation we really should be using pushd and popd, i.e.

pushd ${PREFIX_DIR}/aws-sdk-cpp
# ...do whatever you want to do there
popd

this was the directory remains the same before and after the operatoin you ran. right now you cd into a dir and dont return, that may not have any complications now, but could in the future.

SERVICE_ID=$(git status generated/src/aws-cpp-sdk-* --porcelain | grep "generated/src/" | sed -n 's|.*generated/src/aws-cpp-sdk-\([^/]*\).*|\1|p' | sort -u | tr "\n" "," | sed "s/,$//")
Copy link
Contributor

Choose a reason for hiding this comment

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

on our daily releases i think we want to run all tests not just the ones in SERVICE_ID. so while this does do what we want to it to i think we might want to add another argument called RUN_ALL or something to script to override running all of the tests.

also when this is run in the step does git status generated/src/aws-cpp-sdk-* --porcelain actually produce a output? this is because at this point things are actually committed when this run

export TEST_LAMBDA_CODE_PATH=${PREFIX_DIR}/aws-sdk-cpp/tests/aws-cpp-sdk-lambda-integration-tests/resources
export sts=$(aws sts assume-role --role-arn "$TEST_ASSUME_ROLE_ARN" --role-session-name "${AWS_ROLE_SESSION_NAME}" --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]')
export profile=sdk-integ-test
Expand All @@ -32,4 +34,4 @@ export AWS_PROFILE=$profile
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${PREFIX_DIR}/al2-install/lib64/:${PREFIX_DIR}/al2-build/tests/testing-resources/"
cd "${PREFIX_DIR}/al2-build"
if [ -f "${PREFIX_DIR}/aws-sdk-cpp/tools/scripts/suppressions.txt" ]; then export LSAN_OPTIONS=suppressions="${PREFIX_DIR}/aws-sdk-cpp/tools/scripts/suppressions.txt"; fi
python3 ../aws-sdk-cpp/tools/scripts/run_integration_tests.py --testDir ./tests
python3 ../aws-sdk-cpp/tools/scripts/run_integration_tests.py --testDir ./tests --serviceId ${SERVICE_ID:-""}
4 changes: 3 additions & 1 deletion tools/scripts/build-tests/run-mac-integ-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ AWS_ROLE_SESSION_NAME="$3"

echo "Setting the run environment"
export TEST_ASSUME_ROLE_ARN=arn:aws:iam::${AWS_ACCOUNT}:role/IntegrationTest
cd ${PREFIX_DIR}/aws-sdk-cpp
SERVICE_ID=$(git status generated/src/aws-cpp-sdk-* --porcelain | grep "generated/src/" | sed -n 's|.*generated/src/aws-cpp-sdk-\([^/]*\).*|\1|p' | sort -u | tr "\n" "," | sed "s/,$//")
export TEST_LAMBDA_CODE_PATH=${PREFIX_DIR}/aws-sdk-cpp/tests/aws-cpp-sdk-lambda-integration-tests/resources
export sts=$(aws sts assume-role --role-arn "$TEST_ASSUME_ROLE_ARN" --role-session-name "${AWS_ROLE_SESSION_NAME}" --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]')
export profile=sdk-integ-test
Expand All @@ -32,4 +34,4 @@ export AWS_PROFILE=$profile
export DYLD_LIBRARY_PATH="${CATAPULT_WORKSPACE_DIR}/mac-install/lib:${CATAPULT_WORKSPACE_DIR}/mac-build/tests/testing-resources/"
cd "${PREFIX_DIR}/mac-build"
if [ -f "${PREFIX_DIR}/aws-sdk-cpp/tools/scripts/suppressions.txt" ]; then export LSAN_OPTIONS=suppressions="${PREFIX_DIR}/aws-sdk-cpp/tools/scripts/suppressions.txt"; fi
python3 ../aws-sdk-cpp/tools/scripts/run_integration_tests.py --testDir ./tests
python3 ../aws-sdk-cpp/tools/scripts/run_integration_tests.py --testDir ./tests --serviceId ${SERVICE_ID:-""}
5 changes: 4 additions & 1 deletion tools/scripts/build-tests/run-windows-integ-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ aws configure set aws_access_key_id (${sts}[1] -replace " " -replace "`"" -repla
aws configure set aws_secret_access_key (${sts}[2] -replace " " -replace "`"" -replace ",")
aws configure set aws_session_token (${sts}[3] -replace " " -replace "`"" -replace ",")
aws configure list
cd "${env:PREFIX_DIR}/aws-sdk-cpp"
$SERVICE_ID = (git status generated/src/aws-cpp-sdk-* --porcelain | Select-String "generated/src/" | ForEach-Object { if($_ -match "generated/src/aws-cpp-sdk-([^/]*)") { $matches[1] } } | Sort-Object -Unique) -join ","
cd "../.."
# Run tests
cd "${env:PREFIX_DIR}\\win-build"
python3 ../aws-sdk-cpp/tools/scripts/run_integration_tests.py --testDir ./bin/Debug
if ($SERVICE_ID) { & python ../aws-sdk-cpp/tools/scripts/run_integration_tests.py --testDir ./bin/Debug --serviceId $SERVICE_ID } else { & python ../aws-sdk-cpp/tools/scripts/run_integration_tests.py --testDir ./bin/Debug }
19 changes: 18 additions & 1 deletion tools/scripts/run_integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ def parse_arguments():

parser = argparse.ArgumentParser(description="AWSNativeSDK Run all Integration Tests")
parser.add_argument("--testDir", action="store")
parser.add_argument("--serviceId", action="store")

args = vars(parser.parse_args())
arg_map["testDir"] = args["testDir"] or "./build"
arg_map["serviceId"] = args["serviceId"] or ""

return arg_map

Expand All @@ -35,7 +37,7 @@ def main():
test_has_parent_dir = platform.system() != "Windows"
exe_extension = ".exe" if platform.system() == "Windows" else ""

test_list = [
all_tests = [
"aws-cpp-sdk-core-integration-tests",
"aws-cpp-sdk-transcribestreaming-integ-tests",
"aws-cpp-sdk-dynamodb-unit-tests",
Expand All @@ -59,6 +61,21 @@ def main():
"aws-cpp-sdk-bedrock-runtime-integration-tests"
]

if arguments["serviceId"]:
service_ids = arguments["serviceId"].split(",")
test_list = []
for test in all_tests:
service = test.replace('aws-cpp-sdk-', '').replace('-integration-tests', '').replace('-unit-tests', '').replace('-tests', '')
if service != "core":
for service_id in service_ids:
if service_id == service:
test_list.append(test)
break
else:
test_list.append(test)
else:
test_list = all_tests.copy()

# check for existence of these binaries before adding them to tests
# as they will not always be present
cmake_dependent_tests = [
Expand Down