mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-18 21:21:17 +00:00
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
40 lines
997 B
Python
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)
|