diff options
author | bevc@chromium.org <bevc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-21 05:10:59 +0000 |
---|---|---|
committer | bevc@chromium.org <bevc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-21 05:10:59 +0000 |
commit | 7eb226a6351d7143f78d283e76a172431e34f93c (patch) | |
tree | 8978f6fe88ec13d4b498d593283b77837b15a1a5 /tools/coverity | |
parent | 501a21ec8f0afa4da8ee7f6b139c39deb6a23c74 (diff) | |
download | chromium_src-7eb226a6351d7143f78d283e76a172431e34f93c.zip chromium_src-7eb226a6351d7143f78d283e76a172431e34f93c.tar.gz chromium_src-7eb226a6351d7143f78d283e76a172431e34f93c.tar.bz2 |
Detect 'gclient sync' failures, in order to abort failed coverity runs early
BUG=none
TEST=This has actually been running "in production" for a while, just never got submitted.
The gclient failures of this past week on chromecoverity-Windows prove this works right.
Review URL: http://codereview.chromium.org/3042011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/coverity')
-rw-r--r-- | tools/coverity/coverity.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/coverity/coverity.py b/tools/coverity/coverity.py index 42e14c9..5b20c87 100644 --- a/tools/coverity/coverity.py +++ b/tools/coverity/coverity.py @@ -91,7 +91,9 @@ def _RunCommand(cmd, dry_run, shell=False, echo_cmd=True): # TODO(wtc): Check the return value of subprocess.call, which is the return # value of the command. if not dry_run: - subprocess.call(cmd, shell=shell) + return subprocess.call(cmd, shell=shell) + else: + return 0 def _ReleaseLock(lock_file, lock_filename): """Removes the lockfile. Function-ized so we can bail from anywhere""" @@ -126,7 +128,12 @@ def main(options, args): coverity_password = _ReadPassword(options.coverity_password_file) cmd = 'gclient sync' - _RunCommand(cmd, options.dry_run, shell=True) + gclient_exit = _RunCommand(cmd, options.dry_run, shell=True) + if gclient_exit != 0: + print 'gclient aborted with status %s' % gclient_exit + _ReleaseLock(lock_file, lock_filename) + sys.exit(1) + print 'Elapsed time: %ds' % (time.time() - start_time) # Do a clean build. Remove the build output directory first. @@ -138,7 +145,7 @@ def main(options, args): elif sys.platform == 'darwin': rm_path = os.path.join(options.source_dir,'src','xcodebuild') else: - print 'Platform "%s" unrecognized, don\'t know how to proceed' + print 'Platform "%s" unrecognized, aborting' % sys.platform _ReleaseLock(lock_file, lock_filename) sys.exit(1) |