Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 0 additions & 3 deletions tools/scripts/build-tests/run-al2-smoke-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ if [ -z "$CODEBUILD_SRC_DIR" ]; then
exit 1
fi

echo "Contents of CODEBUILD_SRC_DIR: ${CODEBUILD_SRC_DIR}"
export AWS_SMOKE_TEST_SERVICE_IDS=$(cat $CODEBUILD_SRC_DIR/feature-service-id.json | sed 's/[^:]*:"\\([^"]*\\)"/\\1,/g' | sed 's/,}$//')
ls -la
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${CODEBUILD_SRC_DIR}/al2-install/lib64/"
cd "${CODEBUILD_SRC_DIR}/al2-build"
python3 "../aws-sdk-cpp/tools/scripts/run_smoke_tests.py" --testDir "${CODEBUILD_SRC_DIR}/al2-build" | tee -a results.txt
16 changes: 5 additions & 11 deletions tools/scripts/run_smoke_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
import json
from collections import defaultdict

def should_run_service(services):
service_ids = os.environ.get('AWS_SMOKE_TEST_SERVICE_IDS', '')
print("AWS_SMOKE_TEST_SERVICE_IDS:",service_ids)
if not service_ids:
return services
allowed_services = service_ids.split(',')
return [service for service in services if service in allowed_services]

def main():
parser = argparse.ArgumentParser(description='Run smoke tests')
parser.add_argument('--testDir', default='./build', help='Path to build directory')
Expand All @@ -36,15 +28,17 @@ def main():

total_tests = 0
all_results = defaultdict(list)

services=should_run_service(services)
service_id = os.environ.get('AWS_SMOKE_TEST_SERVICE_IDS', '').strip().lower().replace(' ', '-') if os.environ.get('AWS_SMOKE_TEST_SERVICE_IDS', '').strip() else []
if service_id:
filtered_services = [s for s in services if s in service_id]
services = filtered_services if filtered_services else services

for service in services:
executable = os.path.join(smoke_tests_dir, service, f"{service}-smoke-tests")

with tempfile.NamedTemporaryFile(mode='w+', suffix='.json') as temp_file:
json_output_path = temp_file.name
temp_file.close() # Close it so other processes can write to it
temp_file.close()
test_command = [executable, f'--gtest_output=json:{json_output_path}']
subprocess.run(test_command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

Expand Down
Loading