Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: tools/auto_bisect/bisect_perf_regression.py

Issue 607803005: Trigger build request using git try instead of try_job_http on bisect bots (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/auto_bisect/bisect_perf_regression_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 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 """Performance Test Bisect Tool 6 """Performance Test Bisect Tool
7 7
8 This script bisects a series of changelists using binary search. It starts at 8 This script bisects a series of changelists using binary search. It starts at
9 a bad revision where a performance metric has regressed, and asks for a last 9 a bad revision where a performance metric has regressed, and asks for a last
10 known-good revision. It will then binary search across this revision range by 10 known-good revision. It will then binary search across this revision range by
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 # The confidence percentage at which confidence can be consider "high". 170 # The confidence percentage at which confidence can be consider "high".
171 HIGH_CONFIDENCE = 95 171 HIGH_CONFIDENCE = 95
172 172
173 # Patch template to add a new file, DEPS.sha under src folder. 173 # Patch template to add a new file, DEPS.sha under src folder.
174 # This file contains SHA1 value of the DEPS changes made while bisecting 174 # This file contains SHA1 value of the DEPS changes made while bisecting
175 # dependency repositories. This patch send along with DEPS patch to try server. 175 # dependency repositories. This patch send along with DEPS patch to try server.
176 # When a build requested is posted with a patch, bisect builders on try server, 176 # When a build requested is posted with a patch, bisect builders on try server,
177 # once build is produced, it reads SHA value from this file and appends it 177 # once build is produced, it reads SHA value from this file and appends it
178 # to build archive filename. 178 # to build archive filename.
179 DEPS_SHA_PATCH = """diff --git src/DEPS.sha src/DEPS.sha 179 DEPS_SHA_PATCH = """diff --git DEPS.sha DEPS.sha
180 new file mode 100644 180 new file mode 100644
181 --- /dev/null 181 --- /dev/null
182 +++ src/DEPS.sha 182 +++ DEPS.sha
183 @@ -0,0 +1 @@ 183 @@ -0,0 +1 @@
184 +%(deps_sha)s 184 +%(deps_sha)s
185 """ 185 """
186 186
187 # The possible values of the --bisect_mode flag, which determines what to 187 # The possible values of the --bisect_mode flag, which determines what to
188 # use when classifying a revision as "good" or "bad". 188 # use when classifying a revision as "good" or "bad".
189 BISECT_MODE_MEAN = 'mean' 189 BISECT_MODE_MEAN = 'mean'
190 BISECT_MODE_STD_DEV = 'std_dev' 190 BISECT_MODE_STD_DEV = 'std_dev'
191 BISECT_MODE_RETURN_CODE = 'return_code' 191 BISECT_MODE_RETURN_CODE = 'return_code'
192 192
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 243
244 For more details please visit 244 For more details please visit
245 https://sites.google.com/a/chromium.org/dev/developers/performance-try-bots 245 https://sites.google.com/a/chromium.org/dev/developers/performance-try-bots
246 """ 246 """
247 247
248 RESULTS_THANKYOU = """ 248 RESULTS_THANKYOU = """
249 O O | Visit http://www.chromium.org/developers/core-principles for Chrome's 249 O O | Visit http://www.chromium.org/developers/core-principles for Chrome's
250 X | policy on perf regressions. Contact chrome-perf-dashboard-team with any 250 X | policy on perf regressions. Contact chrome-perf-dashboard-team with any
251 / \ | questions or suggestions about bisecting. THANK YOU.""" 251 / \ | questions or suggestions about bisecting. THANK YOU."""
252 252
253 # Git branch name used to run bisect try jobs.
254 BISECT_TRYJOB_BRANCH = 'bisect-tryjob'
255 # Git master branch name.
256 BISECT_MASTER_BRANCH = 'master'
257 # File to store 'git diff' content.
258 BISECT_PATCH_FILE = 'deps_patch.txt'
259 # SVN repo where the bisect try jobs are submitted.
260 SVN_REPO_URL = 'svn://svn.chromium.org/chrome-try/try-perf'
261
262 class RunGitError(Exception):
263
264 def __str__(self):
265 return '%s\nError executing git command.' % self.args[0]
266
253 267
254 def _AddAdditionalDepotInfo(depot_info): 268 def _AddAdditionalDepotInfo(depot_info):
255 """Adds additional depot info to the global depot variables.""" 269 """Adds additional depot info to the global depot variables."""
256 global DEPOT_DEPS_NAME 270 global DEPOT_DEPS_NAME
257 global DEPOT_NAMES 271 global DEPOT_NAMES
258 DEPOT_DEPS_NAME = dict(DEPOT_DEPS_NAME.items() + depot_info.items()) 272 DEPOT_DEPS_NAME = dict(DEPOT_DEPS_NAME.items() + depot_info.items())
259 DEPOT_NAMES = DEPOT_DEPS_NAME.keys() 273 DEPOT_NAMES = DEPOT_DEPS_NAME.keys()
260 274
261 275
262 def GetSHA1HexDigest(contents): 276 def GetSHA1HexDigest(contents):
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 'was added without proper support?' % depot_name) 853 'was added without proper support?' % depot_name)
840 854
841 def ChangeToDepotDir(self, depot_name): 855 def ChangeToDepotDir(self, depot_name):
842 """Given a depot, changes to the appropriate working directory. 856 """Given a depot, changes to the appropriate working directory.
843 857
844 Args: 858 Args:
845 depot_name: The name of the depot (see DEPOT_NAMES). 859 depot_name: The name of the depot (see DEPOT_NAMES).
846 """ 860 """
847 os.chdir(self.GetDepotDir(depot_name)) 861 os.chdir(self.GetDepotDir(depot_name))
848 862
863 def _PrepareBisectBranch(parent_branch, new_branch):
864 """Creates a new branch to submit bisect try job.
865
866 Args:
867 parent_branch: Parent branch to be used to create new branch.
868 new_branch: New branch name.
869 """
870 current_branch, returncode = bisect_utils.RunGit(
871 ['rev-parse', '--abbrev-ref', 'HEAD'])
872 if returncode:
873 raise RunGitError('Must be in a git repository to send changes to trybots.')
874
875 current_branch = current_branch.strip()
876 # Make sure current branch is master.
877 if current_branch != parent_branch:
878 output, returncode = bisect_utils.RunGit(['checkout', '-f', parent_branch])
879 if returncode:
880 raise RunGitError('Failed to checkout branch: %s.' % output)
881
882 # Delete new branch if exists.
883 output, returncode = bisect_utils.RunGit(['branch', '--list' ])
884 if new_branch in output:
885 output, returncode = bisect_utils.RunGit(['branch', '-D', new_branch])
886 if returncode:
887 raise RunGitError('Deleting branch failed, %s', output)
888
889 # Check if the tree is dirty: make sure the index is up to date and then
890 # run diff-index.
891 bisect_utils.RunGit(['update-index', '--refresh', '-q'])
892 output, returncode = bisect_utils.RunGit(['diff-index', 'HEAD'])
893 if output:
894 raise RunGitError('Cannot send a try job with a dirty tree.')
895
896 # Create/check out the telemetry-tryjob branch, and edit the configs
897 # for the tryjob there.
898 output, returncode = bisect_utils.RunGit(['checkout', '-b', new_branch])
899 if returncode:
900 raise RunGitError('Failed to checkout branch: %s.' % output)
901
902 output, returncode = bisect_utils.RunGit(
903 ['branch', '--set-upstream-to', parent_branch])
904 if returncode:
905 raise RunGitError('Error in git branch --set-upstream-to')
906
907
908 def _BuilderTryjob(git_revision, bot_name, bisect_job_name, patch=None):
909 """Attempts to run a tryjob from the current directory.
910
911 Args:
912 git_revision: A Git hash revision.
913 bot_name: Name of the bisect bot to be used for try job.
914 bisect_job_name: Bisect try job name.
915 patch: A DEPS patch (used while bisecting 3rd party repositories).
916 """
917 try:
918 # Temporary branch for running tryjob.
919 _PrepareBisectBranch(BISECT_MASTER_BRANCH, BISECT_TRYJOB_BRANCH)
920 patch_content = '/dev/null'
921 # Create a temporary patch file, if it fails raise an exception.
922 if patch:
923 WriteStringToFile(patch, BISECT_PATCH_FILE)
924 patch_content = BISECT_PATCH_FILE
925
926 try_cmd = ['try',
927 '-b', bot_name,
928 '-r', git_revision,
929 '-n', bisect_job_name,
930 '--svn_repo=%s' % SVN_REPO_URL,
931 '--diff=%s' % patch_content
932 ]
933 # Execute try job to build revision.
934 output, returncode = bisect_utils.RunGit(try_cmd)
935
936 if returncode:
937 raise RunGitError('Could not execute tryjob: %s.\n Error: %s' % (
938 'git %s' % ' '.join(try_cmd), output))
939 print ('Try job successfully submitted.\n TryJob Details: %s\n%s' % (
940 'git %s' % ' '.join(try_cmd), output))
941 finally:
942 # Delete patch file if exists
943 try:
944 os.remove(BISECT_PATCH_FILE)
945 except OSError as e:
946 if e.errno != errno.ENOENT:
947 raise
948 # Checkout master branch and delete bisect-tryjob branch.
949 bisect_utils.RunGit(['checkout', '-f', BISECT_MASTER_BRANCH])
950 bisect_utils.RunGit(['branch', '-D', BISECT_TRYJOB_BRANCH])
951
849 952
850 class BisectPerformanceMetrics(object): 953 class BisectPerformanceMetrics(object):
851 """This class contains functionality to perform a bisection of a range of 954 """This class contains functionality to perform a bisection of a range of
852 revisions to narrow down where performance regressions may have occurred. 955 revisions to narrow down where performance regressions may have occurred.
853 956
854 The main entry-point is the Run method. 957 The main entry-point is the Run method.
855 """ 958 """
856 959
857 def __init__(self, source_control, opts): 960 def __init__(self, source_control, opts):
858 super(BisectPerformanceMetrics, self).__init__() 961 super(BisectPerformanceMetrics, self).__init__()
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 if not downloaded_archive: 1278 if not downloaded_archive:
1176 # Get commit position for the given SHA. 1279 # Get commit position for the given SHA.
1177 commit_position = self.source_control.GetCommitPosition(revision) 1280 commit_position = self.source_control.GetCommitPosition(revision)
1178 if commit_position: 1281 if commit_position:
1179 # Source archive file path on cloud storage using SVN revision. 1282 # Source archive file path on cloud storage using SVN revision.
1180 source_file = GetRemoteBuildPath( 1283 source_file = GetRemoteBuildPath(
1181 commit_position, self.opts.target_platform, target_arch, patch_sha) 1284 commit_position, self.opts.target_platform, target_arch, patch_sha)
1182 return FetchFromCloudStorage(gs_bucket, source_file, out_dir) 1285 return FetchFromCloudStorage(gs_bucket, source_file, out_dir)
1183 return downloaded_archive 1286 return downloaded_archive
1184 1287
1185 def DownloadCurrentBuild(self, revision, build_type='Release', patch=None): 1288 def DownloadCurrentBuild(self, revision, depot, build_type='Release'):
1186 """Downloads the build archive for the given revision. 1289 """Downloads the build archive for the given revision.
1187 1290
1188 Args: 1291 Args:
1189 revision: The Git revision to download or build. 1292 revision: The Git revision to download or build.
1190 build_type: Target build type ('Release', 'Debug', 'Release_x64' etc.) 1293 build_type: Target build type ('Release', 'Debug', 'Release_x64' etc.)
1191 patch: A DEPS patch (used while bisecting 3rd party repositories). 1294 patch: A DEPS patch (used while bisecting 3rd party repositories).
1192 1295
1193 Returns: 1296 Returns:
1194 True if download succeeds, otherwise False. 1297 True if download succeeds, otherwise False.
1195 """ 1298 """
1299 patch = None
1196 patch_sha = None 1300 patch_sha = None
1301 if depot != 'chromium':
1302 # Create a DEPS patch with new revision for dependency repository.
1303 revision, patch = self.CreateDEPSPatch(depot, revision)
1304
1197 if patch: 1305 if patch:
1198 # Get the SHA of the DEPS changes patch. 1306 # Get the SHA of the DEPS changes patch.
1199 patch_sha = GetSHA1HexDigest(patch) 1307 patch_sha = GetSHA1HexDigest(patch)
1200 1308
1201 # Update the DEPS changes patch with a patch to create a new file named 1309 # Update the DEPS changes patch with a patch to create a new file named
1202 # 'DEPS.sha' and add patch_sha evaluated above to it. 1310 # 'DEPS.sha' and add patch_sha evaluated above to it.
1203 patch = '%s\n%s' % (patch, DEPS_SHA_PATCH % {'deps_sha': patch_sha}) 1311 patch = '%s\n%s' % (patch, DEPS_SHA_PATCH % {'deps_sha': patch_sha})
1204 1312
1205 # Get Build output directory 1313 # Get Build output directory
1206 abs_build_dir = os.path.abspath( 1314 abs_build_dir = os.path.abspath(
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 if bisect_utils.IsLinuxHost(): 1391 if bisect_utils.IsLinuxHost():
1284 if target_platform == 'android': 1392 if target_platform == 'android':
1285 return ('android_perf_bisect_builder', MAX_LINUX_BUILD_TIME) 1393 return ('android_perf_bisect_builder', MAX_LINUX_BUILD_TIME)
1286 return ('linux_perf_bisect_builder', MAX_LINUX_BUILD_TIME) 1394 return ('linux_perf_bisect_builder', MAX_LINUX_BUILD_TIME)
1287 if bisect_utils.IsMacHost(): 1395 if bisect_utils.IsMacHost():
1288 return ('mac_perf_bisect_builder', MAX_MAC_BUILD_TIME) 1396 return ('mac_perf_bisect_builder', MAX_MAC_BUILD_TIME)
1289 raise NotImplementedError('Unsupported Platform "%s".' % sys.platform) 1397 raise NotImplementedError('Unsupported Platform "%s".' % sys.platform)
1290 if not fetch_build: 1398 if not fetch_build:
1291 return False 1399 return False
1292 1400
1293 bot_name, build_timeout = GetBuilderNameAndBuildTime(
1294 self.opts.target_platform, self.opts.target_arch)
1295 builder_host = self.opts.builder_host
1296 builder_port = self.opts.builder_port
1297 # Create a unique ID for each build request posted to try server builders. 1401 # Create a unique ID for each build request posted to try server builders.
1298 # This ID is added to "Reason" property of the build. 1402 # This ID is added to "Reason" property of the build.
1299 build_request_id = GetSHA1HexDigest( 1403 build_request_id = GetSHA1HexDigest(
1300 '%s-%s-%s' % (git_revision, patch, time.time())) 1404 '%s-%s-%s' % (git_revision, patch, time.time()))
1301 1405
1302 # Creates a try job description. 1406 # Reverts any changes to DEPS file.
1303 # Always use Git hash to post build request since Commit positions are 1407 self.source_control.CheckoutFileAtRevision(
1304 # not supported by builders to build. 1408 bisect_utils.FILE_DEPS, git_revision, cwd=self.src_cwd)
1305 job_args = { 1409
1306 'revision': 'src@%s' % git_revision, 1410 bot_name, build_timeout = GetBuilderNameAndBuildTime(
1307 'bot': bot_name, 1411 self.opts.target_platform, self.opts.target_arch)
1308 'name': build_request_id, 1412 target_file = None
1309 } 1413 try:
1310 # Update patch information if supplied. 1414 # Execute try job request to build revision with patch.
1311 if patch: 1415 _BuilderTryjob(git_revision, bot_name, build_request_id, patch)
1312 job_args['patch'] = patch
1313 # Posts job to build the revision on the server.
1314 if request_build.PostTryJob(builder_host, builder_port, job_args):
1315 target_file, error_msg = _WaitUntilBuildIsReady( 1416 target_file, error_msg = _WaitUntilBuildIsReady(
1316 fetch_build, bot_name, builder_host, builder_port, build_request_id, 1417 fetch_build, bot_name, self.opts.builder_host,
1317 build_timeout) 1418 self.opts.builder_port, build_request_id, build_timeout)
1318 if not target_file: 1419 if not target_file:
1319 print '%s [revision: %s]' % (error_msg, git_revision) 1420 print '%s [revision: %s]' % (error_msg, git_revision)
1320 return None 1421 except RunGitError as e:
1321 return target_file 1422 print ('Failed to post builder try job for revision: [%s].\n'
1322 print 'Failed to post build request for revision: [%s]' % git_revision 1423 'Error: %s' % (git_revision, e))
1323 return None 1424
1425 return target_file
1324 1426
1325 def IsDownloadable(self, depot): 1427 def IsDownloadable(self, depot):
1326 """Checks if build can be downloaded based on target platform and depot.""" 1428 """Checks if build can be downloaded based on target platform and depot."""
1327 if (self.opts.target_platform in ['chromium', 'android'] and 1429 if (self.opts.target_platform in ['chromium', 'android'] and
1328 self.opts.gs_bucket): 1430 self.opts.gs_bucket):
1329 return (depot == 'chromium' or 1431 return (depot == 'chromium' or
1330 'chromium' in DEPOT_DEPS_NAME[depot]['from'] or 1432 'chromium' in DEPOT_DEPS_NAME[depot]['from'] or
1331 'v8' in DEPOT_DEPS_NAME[depot]['from']) 1433 'v8' in DEPOT_DEPS_NAME[depot]['from'])
1332 return False 1434 return False
1333 1435
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 updated_deps_content = self.UpdateDepsContents( 1512 updated_deps_content = self.UpdateDepsContents(
1411 deps_contents, depot, revision, deps_var) 1513 deps_contents, depot, revision, deps_var)
1412 # Write changes to DEPS file 1514 # Write changes to DEPS file
1413 if updated_deps_content: 1515 if updated_deps_content:
1414 WriteStringToFile(updated_deps_content, deps_file) 1516 WriteStringToFile(updated_deps_content, deps_file)
1415 return True 1517 return True
1416 except IOError, e: 1518 except IOError, e:
1417 print 'Something went wrong while updating DEPS file. [%s]' % e 1519 print 'Something went wrong while updating DEPS file. [%s]' % e
1418 return False 1520 return False
1419 1521
1522
1420 def CreateDEPSPatch(self, depot, revision): 1523 def CreateDEPSPatch(self, depot, revision):
1421 """Modifies DEPS and returns diff as text. 1524 """Modifies DEPS and returns diff as text.
1422 1525
1423 Args: 1526 Args:
1424 depot: Current depot being bisected. 1527 depot: Current depot being bisected.
1425 revision: A git hash revision of the dependency repository. 1528 revision: A git hash revision of the dependency repository.
1426 1529
1427 Returns: 1530 Returns:
1428 A tuple with git hash of chromium revision and DEPS patch text. 1531 A tuple with git hash of chromium revision and DEPS patch text.
1429 """ 1532 """
1430 deps_file_path = os.path.join(self.src_cwd, bisect_utils.FILE_DEPS) 1533 deps_file_path = os.path.join(self.src_cwd, bisect_utils.FILE_DEPS)
1431 if not os.path.exists(deps_file_path): 1534 if not os.path.exists(deps_file_path):
1432 raise RuntimeError('DEPS file does not exists.[%s]' % deps_file_path) 1535 raise RuntimeError('DEPS file does not exists.[%s]' % deps_file_path)
1433 # Get current chromium revision (git hash). 1536 # Get current chromium revision (git hash).
1434 cmd = ['rev-parse', 'HEAD'] 1537 cmd = ['rev-parse', 'HEAD']
1435 chromium_sha = bisect_utils.CheckRunGit(cmd).strip() 1538 chromium_sha = bisect_utils.CheckRunGit(cmd).strip()
1436 if not chromium_sha: 1539 if not chromium_sha:
1437 raise RuntimeError('Failed to determine Chromium revision for %s' % 1540 raise RuntimeError('Failed to determine Chromium revision for %s' %
1438 revision) 1541 revision)
1439 if ('chromium' in DEPOT_DEPS_NAME[depot]['from'] or 1542 if ('chromium' in DEPOT_DEPS_NAME[depot]['from'] or
1440 'v8' in DEPOT_DEPS_NAME[depot]['from']): 1543 'v8' in DEPOT_DEPS_NAME[depot]['from']):
1441 # Checkout DEPS file for the current chromium revision. 1544 # Checkout DEPS file for the current chromium revision.
1442 if self.source_control.CheckoutFileAtRevision( 1545 if self.source_control.CheckoutFileAtRevision(
1443 bisect_utils.FILE_DEPS, chromium_sha, cwd=self.src_cwd): 1546 bisect_utils.FILE_DEPS, chromium_sha, cwd=self.src_cwd):
1444 if self.UpdateDeps(revision, depot, deps_file_path): 1547 if self.UpdateDeps(revision, depot, deps_file_path):
1445 diff_command = [ 1548 diff_command = [
1446 'diff', 1549 'diff',
1447 '--src-prefix=src/', 1550 '--src-prefix=',
1448 '--dst-prefix=src/', 1551 '--dst-prefix=',
1449 '--no-ext-diff', 1552 '--no-ext-diff',
1450 bisect_utils.FILE_DEPS, 1553 bisect_utils.FILE_DEPS,
1451 ] 1554 ]
1452 diff_text = bisect_utils.CheckRunGit(diff_command, cwd=self.src_cwd) 1555 diff_text = bisect_utils.CheckRunGit(diff_command, cwd=self.src_cwd)
1453 return (chromium_sha, ChangeBackslashToSlashInPatch(diff_text)) 1556 return (chromium_sha, ChangeBackslashToSlashInPatch(diff_text))
1454 else: 1557 else:
1455 raise RuntimeError( 1558 raise RuntimeError(
1456 'Failed to update DEPS file for chromium: [%s]' % chromium_sha) 1559 'Failed to update DEPS file for chromium: [%s]' % chromium_sha)
1457 else: 1560 else:
1458 raise RuntimeError( 1561 raise RuntimeError(
1459 'DEPS checkout Failed for chromium revision : [%s]' % chromium_sha) 1562 'DEPS checkout Failed for chromium revision : [%s]' % chromium_sha)
1460 return (None, None) 1563 return (None, None)
1461 1564
1462 def BuildCurrentRevision(self, depot, revision=None): 1565 def BuildCurrentRevision(self, depot, revision=None):
1463 """Builds chrome and performance_ui_tests on the current revision. 1566 """Builds chrome and performance_ui_tests on the current revision.
1464 1567
1465 Returns: 1568 Returns:
1466 True if the build was successful. 1569 True if the build was successful.
1467 """ 1570 """
1468 if self.opts.debug_ignore_build: 1571 if self.opts.debug_ignore_build:
1469 return True 1572 return True
1470 1573
1471 build_success = False 1574 build_success = False
1472 cwd = os.getcwd() 1575 cwd = os.getcwd()
1473 os.chdir(self.src_cwd) 1576 os.chdir(self.src_cwd)
1474 # Fetch build archive for the given revision from the cloud storage when 1577 # Fetch build archive for the given revision from the cloud storage when
1475 # the storage bucket is passed. 1578 # the storage bucket is passed.
1476 if self.IsDownloadable(depot) and revision: 1579 if self.IsDownloadable(depot) and revision:
1477 deps_patch = None 1580 build_success = self.DownloadCurrentBuild(revision, depot)
1478 if depot != 'chromium':
1479 # Create a DEPS patch with new revision for dependency repository.
1480 revision, deps_patch = self.CreateDEPSPatch(depot, revision)
1481 if self.DownloadCurrentBuild(revision, patch=deps_patch):
1482 if deps_patch:
1483 # Reverts the changes to DEPS file.
1484 self.source_control.CheckoutFileAtRevision(
1485 bisect_utils.FILE_DEPS, revision, cwd=self.src_cwd)
1486 build_success = True
1487 else: 1581 else:
1488 # These codes are executed when bisect bots builds binaries locally. 1582 # These codes are executed when bisect bots builds binaries locally.
1489 build_success = self.builder.Build(depot, self.opts) 1583 build_success = self.builder.Build(depot, self.opts)
1490 os.chdir(cwd) 1584 os.chdir(cwd)
1491 return build_success 1585 return build_success
1492 1586
1493 def RunGClientHooks(self): 1587 def RunGClientHooks(self):
1494 """Runs gclient with runhooks command. 1588 """Runs gclient with runhooks command.
1495 1589
1496 Returns: 1590 Returns:
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 1866
1773 def _PerformPreSyncCleanup(self, depot): 1867 def _PerformPreSyncCleanup(self, depot):
1774 """Performs any necessary cleanup before syncing. 1868 """Performs any necessary cleanup before syncing.
1775 1869
1776 Args: 1870 Args:
1777 depot: Depot name. 1871 depot: Depot name.
1778 1872
1779 Returns: 1873 Returns:
1780 True if successful. 1874 True if successful.
1781 """ 1875 """
1782 if depot == 'chromium' or depot == 'android-chrome': 1876 if depot == 'cros':
1783 # Removes third_party/libjingle. At some point, libjingle was causing
1784 # issues syncing when using the git workflow (crbug.com/266324).
1785 os.chdir(self.src_cwd)
1786 if not bisect_utils.RemoveThirdPartyDirectory('libjingle'):
1787 return False
1788 # Removes third_party/skia. At some point, skia was causing
1789 # issues syncing when using the git workflow (crbug.com/377951).
1790 if not bisect_utils.RemoveThirdPartyDirectory('skia'):
1791 return False
1792 elif depot == 'cros':
1793 return self.PerformCrosChrootCleanup() 1877 return self.PerformCrosChrootCleanup()
1794 return True 1878 return True
1795 1879
1796 def _RunPostSync(self, depot): 1880 def _RunPostSync(self, depot):
1797 """Performs any work after syncing. 1881 """Performs any work after syncing.
1798 1882
1799 Args: 1883 Args:
1800 depot: Depot name. 1884 depot: Depot name.
1801 1885
1802 Returns: 1886 Returns:
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
2632 2716
2633 # If confidence is too low, don't bother outputting good/bad. 2717 # If confidence is too low, don't bother outputting good/bad.
2634 if not confidence: 2718 if not confidence:
2635 state_str = '' 2719 state_str = ''
2636 state_str = state_str.center(13, ' ') 2720 state_str = state_str.center(13, ' ')
2637 2721
2638 cl_link = self._GetViewVCLinkFromDepotAndHash(current_id, 2722 cl_link = self._GetViewVCLinkFromDepotAndHash(current_id,
2639 current_data['depot']) 2723 current_data['depot'])
2640 if not cl_link: 2724 if not cl_link:
2641 cl_link = current_id 2725 cl_link = current_id
2642 commit_position = self.source_control.GetCommitPosition(current_id) 2726 commit_position = self.source_control.GetCommitPosition(
2727 current_id, self.depot_registry.GetDepotDir(current_data['depot']))
2643 commit_position = str(commit_position) 2728 commit_position = str(commit_position)
2644 if not commit_position: 2729 if not commit_position:
2645 commit_position = '' 2730 commit_position = ''
2646 self._PrintTestedCommitsEntry(current_data, commit_position, cl_link, 2731 self._PrintTestedCommitsEntry(current_data, commit_position, cl_link,
2647 state_str) 2732 state_str)
2648 2733
2649 def _PrintReproSteps(self): 2734 def _PrintReproSteps(self):
2650 """Prints out a section of the results explaining how to run the test. 2735 """Prints out a section of the results explaining how to run the test.
2651 2736
2652 This message includes the command used to run the test. 2737 This message includes the command used to run the test.
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
3177 # bugs. If you change this, please update the perf dashboard as well. 3262 # bugs. If you change this, please update the perf dashboard as well.
3178 bisect_utils.OutputAnnotationStepStart('Results') 3263 bisect_utils.OutputAnnotationStepStart('Results')
3179 print 'Error: %s' % e.message 3264 print 'Error: %s' % e.message
3180 if opts.output_buildbot_annotations: 3265 if opts.output_buildbot_annotations:
3181 bisect_utils.OutputAnnotationStepClosed() 3266 bisect_utils.OutputAnnotationStepClosed()
3182 return 1 3267 return 1
3183 3268
3184 3269
3185 if __name__ == '__main__': 3270 if __name__ == '__main__':
3186 sys.exit(main()) 3271 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | tools/auto_bisect/bisect_perf_regression_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698