Junji Watanabe | 79d1c7c | 2019-10-21 04:46:49 +0000 | [diff] [blame] | 1 | #!/usr/bin/env vpython |
| 2 | # Copyright 2019 The LUCI Authors. All rights reserved. |
| 3 | # Use of this source code is governed under the Apache License, Version 2.0 |
| 4 | # that can be found in the LICENSE file. |
| 5 | |
| 6 | import os |
| 7 | import sys |
| 8 | |
| 9 | import six |
| 10 | |
Junji Watanabe | 79d1c7c | 2019-10-21 04:46:49 +0000 | [diff] [blame] | 11 | THIS_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 12 | TESTS_DIR = os.path.join(THIS_DIR, 'tests') |
Junji Watanabe | f1cb0a9 | 2019-10-25 09:39:38 +0000 | [diff] [blame^] | 13 | LUCI_DIR = os.path.dirname(THIS_DIR) |
| 14 | COMPONENTS_DIR = os.path.join(LUCI_DIR, 'appengine', 'components') |
Junji Watanabe | 79d1c7c | 2019-10-21 04:46:49 +0000 | [diff] [blame] | 15 | |
| 16 | def main(): |
| 17 | sys.path.insert(0, TESTS_DIR) |
| 18 | import test_env |
| 19 | test_env.setup() |
| 20 | |
Junji Watanabe | f1cb0a9 | 2019-10-25 09:39:38 +0000 | [diff] [blame^] | 21 | sys.path.insert(0, COMPONENTS_DIR) |
| 22 | from test_support import parallel_test_runner |
| 23 | |
Junji Watanabe | 79d1c7c | 2019-10-21 04:46:49 +0000 | [diff] [blame] | 24 | # Need to specify config path explicitly |
| 25 | # because test_env.setup() changes directory |
Junji Watanabe | f1cb0a9 | 2019-10-25 09:39:38 +0000 | [diff] [blame^] | 26 | cfg = os.path.join(COMPONENTS_DIR, 'test_support', 'unittest.cfg') |
Junji Watanabe | 79d1c7c | 2019-10-21 04:46:49 +0000 | [diff] [blame] | 27 | sys.argv.extend(['-c', cfg]) |
| 28 | |
| 29 | # execute test runner |
| 30 | return parallel_test_runner.run_tests(python3=six.PY3) |
| 31 | |
| 32 | |
| 33 | if __name__ == '__main__': |
| 34 | main() |