OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2012 The Chromium Authors. All rights reserved. | 2 # Copyright 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Tests all master.cfgs to make sure they load properly.""" | 6 """Tests all master.cfgs to make sure they load properly.""" |
7 | 7 |
8 import collections | 8 import collections |
9 import optparse | 9 import optparse |
10 import os | 10 import os |
11 import subprocess | 11 import subprocess |
12 import sys | 12 import sys |
13 import time | 13 import time |
14 | 14 |
15 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 15 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
16 sys.path.insert(0, os.path.join(BASE_DIR, 'scripts')) | 16 sys.path.insert(0, os.path.join(BASE_DIR, 'scripts')) |
17 | 17 |
18 import masters_util | 18 import masters_util |
19 | 19 |
20 from common import chromium_utils | 20 from common import chromium_utils |
21 from common import master_cfg_utils | 21 from common import master_cfg_utils |
22 | 22 |
23 # Masters which do not currently load from the default configuration. These need | 23 # Masters which do not currently load from the default configuration. These need |
24 # to be fixed and removed from the list! | 24 # to be fixed and removed from the list! |
25 BLACKLIST = set(['chromium.swarm', | 25 BLACKLIST = set(['chromium.swarm', |
26 'chromium.chromebot', | 26 'chromium.chromebot', |
27 'chromiumos.tryserver', | 27 'client.nacl.chrome' |
28 'client.nacl.chrome']) | 28 ]) |
29 | 29 |
30 | 30 |
31 Cmd = collections.namedtuple('Cmd', ['name', 'path', 'env']) | 31 Cmd = collections.namedtuple('Cmd', ['name', 'path', 'env']) |
32 | 32 |
33 | 33 |
34 def GetMasterCmds(masters, blacklist, pythonpaths): | 34 def GetMasterCmds(masters, blacklist, pythonpaths): |
35 assert blacklist <= set(m for m, _ in masters) | 35 assert blacklist <= set(m for m, _ in masters) |
36 env = os.environ.copy() | 36 env = os.environ.copy() |
37 pythonpaths = list(pythonpaths or []) | 37 pythonpaths = list(pythonpaths or []) |
38 buildpaths = ['scripts', 'third_party', 'site_config'] | 38 buildpaths = ['scripts', 'third_party', 'site_config'] |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 print GetCommandStr(cmd, out) | 99 print GetCommandStr(cmd, out) |
100 | 100 |
101 test_time = round(time.time() - start_time, 1) | 101 test_time = round(time.time() - start_time, 1) |
102 print 'Parsed %d masters successfully, %d failed, %d skipped in %gs.' % ( | 102 print 'Parsed %d masters successfully, %d failed, %d skipped in %gs.' % ( |
103 len(masters_list), len(failures), num_skipped, test_time) | 103 len(masters_list), len(failures), num_skipped, test_time) |
104 return bool(failures) | 104 return bool(failures) |
105 | 105 |
106 | 106 |
107 if __name__ == '__main__': | 107 if __name__ == '__main__': |
108 sys.exit(main(sys.argv)) | 108 sys.exit(main(sys.argv)) |
OLD | NEW |