forked from aws/aws-sdk-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_integration_tests.py
74 lines (59 loc) · 2.52 KB
/
run_integration_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
#
import argparse
import os
import stat
import subprocess
import platform
import random
import string
def parse_arguments():
arg_map = {}
parser = argparse.ArgumentParser(description="AWSNativeSDK Run all Integration Tests")
parser.add_argument("--testDir", action="store")
args = vars(parser.parse_args())
arg_map["testDir"] = args["testDir"] or "./build"
return arg_map
def add_executable_bit(file):
st = os.stat(file)
os.chmod(file, st.st_mode | stat.S_IEXEC)
def main():
arguments = parse_arguments()
test_has_parent_dir = platform.system() != "Windows"
exe_extension = ".exe" if platform.system() == "Windows" else ""
test_list = [
# "aws-cpp-sdk-transcribestreaming-integration-tests", # Temporarily disabled while investigated
"aws-cpp-sdk-dynamodb-integration-tests",
"aws-cpp-sdk-sqs-integration-tests",
"aws-cpp-sdk-s3-integration-tests",
#"aws-cpp-sdk-s3-crt-integration-tests",
#"aws-cpp-sdk-s3control-integration-tests",
# "aws-cpp-sdk-lambda-integration-tests",
"aws-cpp-sdk-cognitoidentity-integration-tests",
#"aws-cpp-sdk-transfer-tests",
#"aws-cpp-sdk-s3-encryption-integration-tests",
"aws-cpp-sdk-kinesis-integration-tests",
"aws-cpp-sdk-logs-integration-tests",
"aws-cpp-sdk-monitoring-integration-tests",
"aws-cpp-sdk-elasticfilesystem-integration-tests",
"aws-cpp-sdk-rds-integration-tests",
"aws-cpp-sdk-ec2-integration-tests",
"aws-cpp-sdk-timestream-query-integration-tests"]
random.shuffle(test_list)
for testName in test_list:
test_exe = os.path.join(arguments["testDir"], testName if test_has_parent_dir else "", testName) + exe_extension
# when build with BUILD_ONLY, not all test binaries will be generated.
if not os.path.isfile(test_exe):
print("Test: \"{}\" doesn't exist, failing test run.".format(test_exe))
exit(1)
prefix = "--aws_resource_prefix=" + ''.join(
random.choice(string.ascii_lowercase + string.digits) for _ in range(8))
print("testExe = " + test_exe)
print("prefix = " + prefix)
gtest_brief = "--gtest_brief=1"
add_executable_bit(test_exe)
subprocess.check_call([test_exe, prefix, gtest_brief])
# Run from powershell; make sure msbuild is in PATH environment variable
if __name__ == "__main__":
main()