OLD | NEW |
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 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 deps_data = deps_data['deps'] | 1431 deps_data = deps_data['deps'] |
1432 | 1432 |
1433 rxp = re.compile(".git@(?P<revision>[a-fA-F0-9]+)") | 1433 rxp = re.compile(".git@(?P<revision>[a-fA-F0-9]+)") |
1434 results = {} | 1434 results = {} |
1435 for depot_name, depot_data in DEPOT_DEPS_NAME.iteritems(): | 1435 for depot_name, depot_data in DEPOT_DEPS_NAME.iteritems(): |
1436 if (depot_data.get('platform') and | 1436 if (depot_data.get('platform') and |
1437 depot_data.get('platform') != os.name): | 1437 depot_data.get('platform') != os.name): |
1438 continue | 1438 continue |
1439 | 1439 |
1440 if (depot_data.get('recurse') and depot in depot_data.get('from')): | 1440 if (depot_data.get('recurse') and depot in depot_data.get('from')): |
1441 src_dir = (deps_data.get(depot_data.get('src')) or | 1441 depot_data_src = depot_data.get('src') or depot_data.get('src_old') |
1442 deps_data.get(depot_data.get('src_old'))) | 1442 src_dir = deps_data.get(depot_data_src) |
1443 if src_dir: | 1443 if src_dir: |
1444 self.depot_cwd[depot_name] = os.path.join(self.src_cwd, src_dir[4:]) | 1444 self.depot_cwd[depot_name] = os.path.join(self.src_cwd, |
1445 re_results = rxp.search(deps_data.get(src_dir, '')) | 1445 depot_data_src[4:]) |
| 1446 re_results = rxp.search(src_dir) |
1446 if re_results: | 1447 if re_results: |
1447 results[depot_name] = re_results.group('revision') | 1448 results[depot_name] = re_results.group('revision') |
1448 else: | 1449 else: |
1449 warning_text = ('Couldn\'t parse revision for %s while bisecting ' | 1450 warning_text = ('Couldn\'t parse revision for %s while bisecting ' |
1450 '%s' % (depot_name, depot)) | 1451 '%s' % (depot_name, depot)) |
1451 if not warning_text in self.warnings: | 1452 if not warning_text in self.warnings: |
1452 self.warnings.append(warning_text) | 1453 self.warnings.append(warning_text) |
1453 else: | 1454 else: |
1454 results[depot_name] = None | 1455 results[depot_name] = None |
1455 return results | 1456 return results |
1456 except ImportError: | 1457 except ImportError: |
1457 deps_file_contents = ReadStringFromFile(bisect_utils.FILE_DEPS_GIT) | 1458 deps_file_contents = ReadStringFromFile(bisect_utils.FILE_DEPS_GIT) |
1458 parse_results = self._ParseRevisionsFromDEPSFileManually( | 1459 parse_results = self._ParseRevisionsFromDEPSFileManually( |
1459 deps_file_contents) | 1460 deps_file_contents) |
1460 results = {} | 1461 results = {} |
(...skipping 2452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3913 # The perf dashboard scrapes the "results" step in order to comment on | 3914 # The perf dashboard scrapes the "results" step in order to comment on |
3914 # bugs. If you change this, please update the perf dashboard as well. | 3915 # bugs. If you change this, please update the perf dashboard as well. |
3915 bisect_utils.OutputAnnotationStepStart('Results') | 3916 bisect_utils.OutputAnnotationStepStart('Results') |
3916 print 'Error: %s' % e.message | 3917 print 'Error: %s' % e.message |
3917 if opts.output_buildbot_annotations: | 3918 if opts.output_buildbot_annotations: |
3918 bisect_utils.OutputAnnotationStepClosed() | 3919 bisect_utils.OutputAnnotationStepClosed() |
3919 return 1 | 3920 return 1 |
3920 | 3921 |
3921 if __name__ == '__main__': | 3922 if __name__ == '__main__': |
3922 sys.exit(main()) | 3923 sys.exit(main()) |
OLD | NEW |