- Notifications
You must be signed in to change notification settings - Fork 384
/
Copy pathrun_gate_tests.py
65 lines (49 loc) · 2.21 KB
/
run_gate_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
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
importsys
importos
fromsubprocessimportcheck_call
this_file_path=os.path.dirname(os.path.realpath(__file__))
failures= []
defrun_test_app(relative_app_name, timeout):
absolute_app=os.path.join(this_file_path, relative_app_name)
try:
print("+-"*66)
print()
print("Running test app: {}".format(absolute_app))
check_call([sys.executable] +absolute_app.split(), timeout=timeout)
print("Test app {} SUCCEEDED".format(absolute_app))
exceptExceptionaserr:
print(err)
print("Test app {} FAILED".format(absolute_app))
failures.push("{} failed with {}".format(relative_app_name, str(err) ortype(err)))
print()
print("+-"*66)
print()
print()
if__name__=="__main__":
run_test_app("./simple_stress/simple_send_message_bulk.py", timeout=600)
run_test_app("./regressions/regression_pr_1023_infinite_get_twin.py", timeout=600)
run_test_app("./regressions/regression_issue_990_exception_after_publish.py", timeout=600)
run_test_app("./fuzzing/fuzz_send_message.py 1", timeout=600)
run_test_app("./fuzzing/fuzz_send_message.py 3", timeout=600)
# individual dropped PUBLISH messages don't get retried until after reconnect, so these 2 are
# currently commented out.
# run_test_app("./fuzzing/fuzz_send_message.py 2", timeout=600)
# run_test_app("./fuzzing/fuzz_send_message.py 4", timeout=600)
# exceptions in the Paho thread aren't caught and handled, so these 2 are currently commented out.
# run_test_app("./fuzzing/fuzz_send_message.py 5", timeout=600)
# run_test_app("./fuzzing/fuzz_send_message.py 6", timeout=600)
print("+-"*66)
print()
print("FINAL RESULT: {}".format("FAILED"iflen(failures) else"SUCCEEDED"))
iflen(failures):
print()
forfailureinfailures:
print(failure)
print()
print("+-"*66)
sys.exit(len(failures))