onnxruntime/server/test/integration_tests/test_main.py
Justin Chu fdce4fa6af
Format all python files under onnxruntime with black and isort (#11324)
Description: Format all python files under onnxruntime with black and isort.

After checking in, we can use .git-blame-ignore-revs to ignore the formatting PR in git blame.

#11315, #11316
2022-04-26 09:35:16 -07:00

40 lines
997 B
Python

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import random
import sys
import unittest
if __name__ == "__main__":
sys.path.append(sys.argv[4])
sys.path.append(sys.argv[5])
import function_tests
loader = unittest.TestLoader()
test_classes = [
function_tests.HttpJsonPayloadTests,
function_tests.HttpProtobufPayloadTests,
function_tests.HttpEndpointTests,
function_tests.GRPCTests,
]
test_suites = []
for tests in test_classes:
tests.server_app_path = sys.argv[1]
tests.model_path = sys.argv[2]
tests.test_data_path = sys.argv[3]
tests.server_port = random.randint(30000, 50000)
test_suites.append(loader.loadTestsFromTestCase(tests))
suites = unittest.TestSuite(test_suites)
runner = unittest.TextTestRunner(verbosity=2)
results = runner.run(suites)
if results.wasSuccessful():
exit(0)
else:
exit(1)