| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Base class for all slave-side build steps. """ | 5 """Base class for all slave-side build steps. """ |
| 6 | 6 |
| 7 import config | 7 import config |
| 8 # pylint: disable=W0611 | 8 # pylint: disable=W0611 |
| 9 import flavor_utils | 9 import flavor_utils |
| 10 import imp | 10 import imp |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 # Add important directories to the PYTHONPATH | 26 # Add important directories to the PYTHONPATH |
| 27 sys.path.append(os.path.join(BUILDBOT_PATH)) | 27 sys.path.append(os.path.join(BUILDBOT_PATH)) |
| 28 sys.path.append(os.path.join(BUILDBOT_PATH, 'site_config')) | 28 sys.path.append(os.path.join(BUILDBOT_PATH, 'site_config')) |
| 29 sys.path.append(os.path.join(BUILDBOT_PATH, 'master')) | 29 sys.path.append(os.path.join(BUILDBOT_PATH, 'master')) |
| 30 sys.path.insert(0, os.path.join(BUILDBOT_PATH, 'common')) | 30 sys.path.insert(0, os.path.join(BUILDBOT_PATH, 'common')) |
| 31 | 31 |
| 32 import builder_name_schema | 32 import builder_name_schema |
| 33 import slave_hosts_cfg | 33 import slave_hosts_cfg |
| 34 import slaves_cfg | 34 import slaves_cfg |
| 35 | 35 |
| 36 from py.utils import gs_utils |
| 36 from py.utils import misc | 37 from py.utils import misc |
| 37 | 38 |
| 38 | 39 |
| 39 DEFAULT_TIMEOUT = 4800 | 40 DEFAULT_TIMEOUT = 4800 |
| 40 DEFAULT_NO_OUTPUT_TIMEOUT = 3600 | 41 DEFAULT_NO_OUTPUT_TIMEOUT = 3600 |
| 41 DEFAULT_NUM_CORES = 2 | 42 DEFAULT_NUM_CORES = 2 |
| 42 | 43 |
| 43 | 44 |
| 44 GM_EXPECTATIONS_FILENAME = 'expected-results.json' | 45 GM_EXPECTATIONS_FILENAME = 'expected-results.json' |
| 45 GM_IGNORE_FAILURES_FILE = 'ignored-tests.txt' | 46 GM_IGNORE_FAILURES_FILE = 'ignored-tests.txt' |
| 46 | 47 |
| 47 | 48 |
| 48 # multiprocessing.Value doesn't accept boolean types, so we have to use an int. | 49 # multiprocessing.Value doesn't accept boolean types, so we have to use an int. |
| 49 INT_TRUE = 1 | 50 INT_TRUE = 1 |
| 50 INT_FALSE = 0 | 51 INT_FALSE = 0 |
| 51 build_step_stdout_has_written = multiprocessing.Value('i', INT_FALSE) | 52 build_step_stdout_has_written = multiprocessing.Value('i', INT_FALSE) |
| 52 | 53 |
| 53 | 54 |
| 54 # The canned acl to use while copying playback files to Google Storage. | 55 # The canned acl to use while copying playback (SKP) files to Google Storage. |
| 55 PLAYBACK_CANNED_ACL = 'private' | 56 # They should not be world-readable! |
| 57 PLAYBACK_CANNED_ACL = gs_utils.PREDEFINED_ACL_PRIVATE |
| 58 PLAYBACK_FINEGRAINED_ACL_LIST = [ |
| 59 (gs_utils.ID_TYPE_GROUP_BY_DOMAIN, 'google.com', gs_utils.PERMISSION_READ), |
| 60 ] |
| 61 BOTO_CREDENTIALS_FILE = os.path.join( |
| 62 BUILDBOT_PATH, 'third_party', 'chromium_buildbot', 'site_config', '.boto') |
| 56 | 63 |
| 57 | 64 |
| 58 class BuildStepWarning(Exception): | 65 class BuildStepWarning(Exception): |
| 59 pass | 66 pass |
| 60 | 67 |
| 61 | 68 |
| 62 class BuildStepFailure(Exception): | 69 class BuildStepFailure(Exception): |
| 63 pass | 70 pass |
| 64 | 71 |
| 65 | 72 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 else: | 399 else: |
| 393 raise BuildStepFailure('Build step failed.') | 400 raise BuildStepFailure('Build step failed.') |
| 394 except Exception: | 401 except Exception: |
| 395 print traceback.format_exc() | 402 print traceback.format_exc() |
| 396 if attempt + 1 >= step.attempts: | 403 if attempt + 1 >= step.attempts: |
| 397 raise | 404 raise |
| 398 # pylint: disable=W0212 | 405 # pylint: disable=W0212 |
| 399 step._WaitFunc(attempt) | 406 step._WaitFunc(attempt) |
| 400 attempt += 1 | 407 attempt += 1 |
| 401 print '**** %s, attempt %d ****' % (StepType.__name__, attempt + 1) | 408 print '**** %s, attempt %d ****' % (StepType.__name__, attempt + 1) |
| OLD | NEW |