Commit f0b61609 authored by prasadv's avatar prasadv Committed by Commit bot

Set appropriate working directory on build failure.

Bisect working directory was not reset on build failures, because of this svn commands were executed in wrong directory.

BUG=391109
NOTRY=true

Review URL: https://codereview.chromium.org/555503004

Cr-Commit-Position: refs/heads/master@{#293942}
parent 32ec939f
...@@ -1525,6 +1525,8 @@ class BisectPerformanceMetrics(object): ...@@ -1525,6 +1525,8 @@ class BisectPerformanceMetrics(object):
""" """
if self.opts.debug_ignore_build: if self.opts.debug_ignore_build:
return True return True
build_success = False
cwd = os.getcwd() cwd = os.getcwd()
os.chdir(self.src_cwd) os.chdir(self.src_cwd)
# Fetch build archive for the given revision from the cloud storage when # Fetch build archive for the given revision from the cloud storage when
...@@ -1535,16 +1537,14 @@ class BisectPerformanceMetrics(object): ...@@ -1535,16 +1537,14 @@ class BisectPerformanceMetrics(object):
# Create a DEPS patch with new revision for dependency repository. # Create a DEPS patch with new revision for dependency repository.
revision, deps_patch = self.CreateDEPSPatch(depot, revision) revision, deps_patch = self.CreateDEPSPatch(depot, revision)
if self.DownloadCurrentBuild(revision, patch=deps_patch): if self.DownloadCurrentBuild(revision, patch=deps_patch):
os.chdir(cwd)
if deps_patch: if deps_patch:
# Reverts the changes to DEPS file. # Reverts the changes to DEPS file.
self.source_control.CheckoutFileAtRevision( self.source_control.CheckoutFileAtRevision(
bisect_utils.FILE_DEPS, revision, cwd=self.src_cwd) bisect_utils.FILE_DEPS, revision, cwd=self.src_cwd)
return True build_success = True
return False else:
# These codes are executed when bisect bots builds binaries locally.
# These codes are executed when bisect bots builds binaries locally. build_success = self.builder.Build(depot, self.opts)
build_success = self.builder.Build(depot, self.opts)
os.chdir(cwd) os.chdir(cwd)
return build_success return build_success
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment