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 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1894 Args: | 1894 Args: |
1895 good_revision: Number/tag of the known good revision. | 1895 good_revision: Number/tag of the known good revision. |
1896 bad_revision: Number/tag of the known bad revision. | 1896 bad_revision: Number/tag of the known bad revision. |
1897 | 1897 |
1898 Returns: | 1898 Returns: |
1899 True if the revisions are in the proper order (good earlier than bad). | 1899 True if the revisions are in the proper order (good earlier than bad). |
1900 """ | 1900 """ |
1901 cwd = self.depot_registry.GetDepotDir(target_depot) | 1901 cwd = self.depot_registry.GetDepotDir(target_depot) |
1902 good_position = source_control.GetCommitPosition(good_revision, cwd) | 1902 good_position = source_control.GetCommitPosition(good_revision, cwd) |
1903 bad_position = source_control.GetCommitPosition(bad_revision, cwd) | 1903 bad_position = source_control.GetCommitPosition(bad_revision, cwd) |
| 1904 # Compare commit timestamp for repos that don't support commit position. |
| 1905 if not (bad_position and good_position): |
| 1906 good_position = source_control.GetCommitTime(good_revision, cwd=cwd) |
| 1907 bad_position = source_control.GetCommitTime(bad_revision, cwd=cwd) |
1904 | 1908 |
1905 return good_position <= bad_position | 1909 return good_position <= bad_position |
1906 | 1910 |
1907 def CanPerformBisect(self, good_revision, bad_revision): | 1911 def CanPerformBisect(self, good_revision, bad_revision): |
1908 """Checks whether a given revision is bisectable. | 1912 """Checks whether a given revision is bisectable. |
1909 | 1913 |
1910 Checks for following: | 1914 Checks for following: |
1911 1. Non-bisectable revsions for android bots (refer to crbug.com/385324). | 1915 1. Non-bisectable revsions for android bots (refer to crbug.com/385324). |
1912 2. Non-bisectable revsions for Windows bots (refer to crbug.com/405274). | 1916 2. Non-bisectable revsions for Windows bots (refer to crbug.com/405274). |
1913 | 1917 |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2592 # bugs. If you change this, please update the perf dashboard as well. | 2596 # bugs. If you change this, please update the perf dashboard as well. |
2593 bisect_utils.OutputAnnotationStepStart('Results') | 2597 bisect_utils.OutputAnnotationStepStart('Results') |
2594 print 'Runtime Error: %s' % e | 2598 print 'Runtime Error: %s' % e |
2595 if opts.output_buildbot_annotations: | 2599 if opts.output_buildbot_annotations: |
2596 bisect_utils.OutputAnnotationStepClosed() | 2600 bisect_utils.OutputAnnotationStepClosed() |
2597 return 1 | 2601 return 1 |
2598 | 2602 |
2599 | 2603 |
2600 if __name__ == '__main__': | 2604 if __name__ == '__main__': |
2601 sys.exit(main()) | 2605 sys.exit(main()) |
OLD | NEW |