Adrià Vilanova MartÃnez | f19ea43 | 2024-01-23 20:20:52 +0100 | [diff] [blame^] | 1 | # Copyright 2023 The Chromium Authors |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | """Sets up Monorail's test environment and runs tests.""" |
| 5 | |
| 6 | import os |
| 7 | import sys |
| 8 | |
| 9 | import pytest |
| 10 | |
| 11 | # gae_ts_mon's __init__.py does some import magic to create an infra_libs |
| 12 | # package, so we need to import it before importing Monorail packages. |
| 13 | import gae_ts_mon |
| 14 | |
| 15 | import import_utils |
| 16 | |
| 17 | if __name__ == '__main__': |
| 18 | os.environ['GAE_RUNTIME'] = 'python3' |
| 19 | os.environ['GAE_APPLICATION'] = 'testing-app' |
| 20 | os.environ['SERVER_SOFTWARE'] = 'test' |
| 21 | |
| 22 | import_utils.FixImports() |
| 23 | |
| 24 | args = ['-Werror'] |
| 25 | args += ['--ignore', 'components'] |
| 26 | args += ['--ignore', 'gae_ts_mon'] |
| 27 | args += ['--reruns', '2'] |
| 28 | sys.exit(pytest.main(args + sys.argv[1:])) |