OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import collections | 7 import collections |
8 import json | 8 import json |
9 import optparse | 9 import optparse |
10 import os | 10 import os |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 print 'Using config:', bot_config | 171 print 'Using config:', bot_config |
172 | 172 |
173 def CommandToString(command): | 173 def CommandToString(command): |
174 """Returns quoted command that can be run in bash shell.""" | 174 """Returns quoted command that can be run in bash shell.""" |
175 return ' '.join(map(pipes.quote, command)) | 175 return ' '.join(map(pipes.quote, command)) |
176 | 176 |
177 command_objs = GetCommands(options, bot_config) | 177 command_objs = GetCommands(options, bot_config) |
178 for command_obj in command_objs: | 178 for command_obj in command_objs: |
179 print 'Will run:', CommandToString(command_obj.command) | 179 print 'Will run:', CommandToString(command_obj.command) |
180 | 180 |
181 return_code = 0 | |
182 for command_obj in command_objs: | 181 for command_obj in command_objs: |
183 if command_obj.step_name: | 182 if command_obj.step_name: |
184 buildbot_report.PrintNamedStep(command_obj.step_name) | 183 buildbot_report.PrintNamedStep(command_obj.step_name) |
185 command = command_obj.command | 184 command = command_obj.command |
186 print CommandToString(command) | 185 print CommandToString(command) |
187 sys.stdout.flush() | 186 sys.stdout.flush() |
188 env = None | 187 env = None |
189 if options.TESTING: | 188 if options.TESTING: |
190 # The bash command doesn't yet support the testing option. | 189 # The bash command doesn't yet support the testing option. |
191 if command[0] == 'bash': | 190 if command[0] == 'bash': |
192 continue | 191 continue |
193 env = dict(os.environ) | 192 env = dict(os.environ) |
194 env['BUILDBOT_TESTING'] = '1' | 193 env['BUILDBOT_TESTING'] = '1' |
195 | 194 |
196 return_code |= subprocess.call(command, cwd=CHROME_SRC, env=env) | 195 return_code = subprocess.call(command, cwd=CHROME_SRC, env=env) |
197 return return_code | 196 if return_code != 0: |
197 return return_code | |
198 | 198 |
Yaron
2013/02/21 02:02:49
Shouldn't it return 0 at the end if we reach it?
| |
199 | 199 |
200 if __name__ == '__main__': | 200 if __name__ == '__main__': |
201 sys.exit(main(sys.argv)) | 201 sys.exit(main(sys.argv)) |
OLD | NEW |