Skip to content

Commit 053a6b5

Browse files
committed
Smoke tests environment improvements
- Update run_smoke_tests.py with proper exit codes - Update run-al2-smoke-tests.sh script
1 parent 4d13fe0 commit 053a6b5

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

tools/scripts/build-tests/run-al2-smoke-tests.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ if [ -z "$CODEBUILD_SRC_DIR" ]; then
1515
exit 1
1616
fi
1717

18-
echo "Contents of CODEBUILD_SRC_DIR: ${CODEBUILD_SRC_DIR}"
19-
export AWS_SMOKE_TEST_SERVICE_IDS=$(cat $CODEBUILD_SRC_DIR/feature-service-id.json | sed 's/[^:]*:"\\([^"]*\\)"/\\1,/g' | sed 's/,}$//')
20-
ls -la
2118
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${CODEBUILD_SRC_DIR}/al2-install/lib64/"
2219
cd "${CODEBUILD_SRC_DIR}/al2-build"
2320
python3 "../aws-sdk-cpp/tools/scripts/run_smoke_tests.py" --testDir "${CODEBUILD_SRC_DIR}/al2-build" | tee -a results.txt

tools/scripts/run_smoke_tests.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
import json
77
from collections import defaultdict
88

9-
def should_run_service(services):
10-
service_ids = os.environ.get('AWS_SMOKE_TEST_SERVICE_IDS', '')
11-
print("AWS_SMOKE_TEST_SERVICE_IDS:",service_ids)
12-
if not service_ids:
13-
return services
14-
allowed_services = service_ids.split(',')
15-
return [service for service in services if service in allowed_services]
16-
179
def main():
1810
parser = argparse.ArgumentParser(description='Run smoke tests')
1911
parser.add_argument('--testDir', default='./build', help='Path to build directory')
@@ -37,14 +29,19 @@ def main():
3729
total_tests = 0
3830
all_results = defaultdict(list)
3931

40-
services=should_run_service(services)
32+
service_ids = os.environ.get('AWS_SMOKE_TEST_SERVICE_IDS', '')
33+
if not service_ids:
34+
return 0
35+
allowed_services = service_ids.split(',')
36+
allowed_services = [s.strip().lower().replace(' ', '-') for s in allowed_services] # Convert uppercase to lowercase and spaces to hyphens
37+
services=[service for service in services if service in allowed_services]
4138

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

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

0 commit comments

Comments
 (0)