| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from google.appengine.api import users | 5 from google.appengine.api import users |
| 6 | 6 |
| 7 from common import constants | 7 from common import constants |
| 8 from common.base_handler import BaseHandler | 8 from common.base_handler import BaseHandler |
| 9 from common.base_handler import Permission | 9 from common.base_handler import Permission |
| 10 from model.analysis_status import STATUS_TO_DESCRIPTION | 10 from model.analysis_status import STATUS_TO_DESCRIPTION |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 force = (users.is_current_user_admin() and | 25 force = (users.is_current_user_admin() and |
| 26 self.request.get('force') == '1') | 26 self.request.get('force') == '1') |
| 27 | 27 |
| 28 master_flake_analysis = ScheduleAnalysisIfNeeded( | 28 master_flake_analysis = ScheduleAnalysisIfNeeded( |
| 29 master_name, builder_name, build_number, step_name, | 29 master_name, builder_name, build_number, step_name, |
| 30 test_name, force=force, queue_name=constants.WATERFALL_ANALYSIS_QUEUE) | 30 test_name, force=force, queue_name=constants.WATERFALL_ANALYSIS_QUEUE) |
| 31 data = { | 31 data = { |
| 32 'success_rates': [], | 32 'success_rates': [], |
| 33 'analysis_status': STATUS_TO_DESCRIPTION.get( | 33 'analysis_status': STATUS_TO_DESCRIPTION.get( |
| 34 master_flake_analysis.status), | 34 master_flake_analysis.status), |
| 35 'suspected_flake_build_number':( | 35 'suspected_flake_build_number': ( |
| 36 master_flake_analysis.suspected_flake_build_number) | 36 master_flake_analysis.suspected_flake_build_number), |
| 37 'master_name': master_name, |
| 38 'builder_name': builder_name, |
| 39 'build_number': build_number, |
| 40 'step_name': step_name, |
| 41 'test_name': test_name |
| 37 } | 42 } |
| 38 zipped = zip(master_flake_analysis.build_numbers, | 43 zipped = zip(master_flake_analysis.build_numbers, |
| 39 master_flake_analysis.success_rates) | 44 master_flake_analysis.success_rates) |
| 40 zipped.sort(key = lambda x: x[0]) | 45 zipped.sort(key = lambda x: x[0]) |
| 41 for (build_number, success_rate) in zipped: | 46 for (build_number, success_rate) in zipped: |
| 42 data['success_rates'].append([build_number, success_rate]) | 47 data['success_rates'].append([build_number, success_rate]) |
| 43 return { | 48 return { |
| 44 'template': 'flake/result.html', | 49 'template': 'flake/result.html', |
| 45 'data': data | 50 'data': data |
| 46 } | 51 } |
| OLD | NEW |