blob: dee71574890f7e23c3b594e569f03f6488ce2ef0 [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001# 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
6import os
7import sys
8
9import 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.
13import gae_ts_mon
14
15import import_utils
16
17if __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:]))