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

Side by Side Diff: appengine/findit/handlers/flake/check_flake.py

Issue 2243673002: [Findit] Added algorithm to analysis (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: gclient sync Created 4 years, 4 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 | appengine/findit/handlers/flake/flake_dashboard.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 # 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 waterfall.flake.initialize_flake_pipeline import ScheduleAnalysisIfNeeded 11 from waterfall.flake.initialize_flake_pipeline import ScheduleAnalysisIfNeeded
11 12
12 13
13 class CheckFlake(BaseHandler): 14 class CheckFlake(BaseHandler):
14 PERMISSION_LEVEL = Permission.CORP_USER 15 PERMISSION_LEVEL = Permission.CORP_USER
15 16
16 def HandleGet(self): 17 def HandleGet(self):
17 # Get input parameters. 18 # Get input parameters.
18 # pylint: disable=W0612 19 # pylint: disable=W0612
19 master_name = self.request.get('master_name').strip() 20 master_name = self.request.get('master_name').strip()
20 builder_name = self.request.get('builder_name').strip() 21 builder_name = self.request.get('builder_name').strip()
21 build_number = int(self.request.get('build_number').strip()) 22 build_number = int(self.request.get('build_number').strip())
22 step_name = self.request.get('step_name').strip() 23 step_name = self.request.get('step_name').strip()
23 test_name = self.request.get('test_name').strip() 24 test_name = self.request.get('test_name').strip()
24 force = (users.is_current_user_admin() and 25 force = (users.is_current_user_admin() and
25 self.request.get('force') == '1') 26 self.request.get('force') == '1')
26 27
27 master_flake_analysis = ScheduleAnalysisIfNeeded( 28 master_flake_analysis = ScheduleAnalysisIfNeeded(
28 master_name, builder_name, build_number, step_name, 29 master_name, builder_name, build_number, step_name,
29 test_name, force=force, queue_name=constants.WATERFALL_ANALYSIS_QUEUE) 30 test_name, force=force, queue_name=constants.WATERFALL_ANALYSIS_QUEUE)
30 data = { 31 data = {
31 'success_rates': [] 32 'success_rates': [],
33 'analysis_status': STATUS_TO_DESCRIPTION.get(
34 master_flake_analysis.status),
35 'suspected_flake_build_number':(
36 master_flake_analysis.suspected_flake_build_number)
32 } 37 }
33 for (build_number, success_rate) in zip( 38 zipped = zip(master_flake_analysis.build_numbers,
34 master_flake_analysis.build_numbers, 39 master_flake_analysis.success_rates)
35 master_flake_analysis.success_rates): 40 zipped.sort(key = lambda x: x[0])
41 for (build_number, success_rate) in zipped:
36 data['success_rates'].append([build_number, success_rate]) 42 data['success_rates'].append([build_number, success_rate])
37 return { 43 return {
38 'template': 'flake/result.html', 44 'template': 'flake/result.html',
39 'data': data 45 'data': data
40 } 46 }
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/handlers/flake/flake_dashboard.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698