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

Side by Side Diff: media/tools/layout_tests/layouttest_analyzer_helpers.py

Issue 7789008: Added an option to append text at the end of the status email n layout test analyzer tool. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modification based on CR comments. Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « media/tools/layout_tests/layouttest_analyzer.py ('k') | no next file » | 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 """Helper functions for the layout test analyzer.""" 6 """Helper functions for the layout test analyzer."""
7 7
8 import copy 8 import copy
9 from datetime import datetime 9 from datetime import datetime
10 from email.mime.multipart import MIMEMultipart 10 from email.mime.multipart import MIMEMultipart
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 main_te_info[k] = True 258 main_te_info[k] = True
259 if 'Bugs' in te_info: 259 if 'Bugs' in te_info:
260 for bug in te_info['Bugs']: 260 for bug in te_info['Bugs']:
261 if bug not in bug_map: 261 if bug not in bug_map:
262 bug_map[bug] = [] 262 bug_map[bug] = []
263 bug_map[bug].append((name, main_te_info)) 263 bug_map[bug].append((name, main_te_info))
264 return bug_map 264 return bug_map
265 265
266 266
267 def SendStatusEmail(prev_time, analyzer_result_map, prev_analyzer_result_map, 267 def SendStatusEmail(prev_time, analyzer_result_map, prev_analyzer_result_map,
268 bug_anno_map, receiver_email_address, test_group_name): 268 bug_anno_map, receiver_email_address, test_group_name,
269 appended_text_to_email):
269 """Send status email. 270 """Send status email.
270 271
271 Args: 272 Args:
272 prev_time: the date string such as '2011-10-09-11'. This format has been 273 prev_time: the date string such as '2011-10-09-11'. This format has been
273 used in this analyzer. 274 used in this analyzer.
274 analyzer_result_map: current analyzer result. 275 analyzer_result_map: current analyzer result.
275 prev_analyzer_result_map: previous analyzer result, which is read from 276 prev_analyzer_result_map: previous analyzer result, which is read from
276 a file. 277 a file.
277 bug_anno_map: bug annotation map where bug name and annotations are 278 bug_anno_map: bug annotation map where bug name and annotations are
278 stored. 279 stored.
279 receiver_email_address: receiver's email address. 280 receiver_email_address: receiver's email address.
280 test_group_name: string representing the test group name (e.g., 'media'). 281 test_group_name: string representing the test group name (e.g., 'media').
282 appended_text_to_email: a text which is appended at the end of the status
283 email.
281 """ 284 """
282 diff_map = analyzer_result_map.CompareToOtherResultMap( 285 diff_map = analyzer_result_map.CompareToOtherResultMap(
283 prev_analyzer_result_map) 286 prev_analyzer_result_map)
284 str = analyzer_result_map.ConvertToString(prev_time, diff_map, bug_anno_map) 287 str = analyzer_result_map.ConvertToString(prev_time, diff_map, bug_anno_map)
285 # Add diff info about skipped/non-skipped test. 288 # Add diff info about skipped/non-skipped test.
286 prev_time = datetime.strptime(prev_time, '%Y-%m-%d-%H') 289 prev_time = datetime.strptime(prev_time, '%Y-%m-%d-%H')
287 prev_time = time.mktime(prev_time.timetuple()) 290 prev_time = time.mktime(prev_time.timetuple())
288 testname_map = {} 291 testname_map = {}
289 for type in ['skip', 'nonskip']: 292 for type in ['skip', 'nonskip']:
290 for i in range(2): 293 for i in range(2):
(...skipping 17 matching lines...) Expand all
308 str += '<li>%s</li>\n<ul>' % date 311 str += '<li>%s</li>\n<ul>' % date
309 for line in target_lines: 312 for line in target_lines:
310 str += '<li>%s</li>\n' % line 313 str += '<li>%s</li>\n' % line
311 str += '</ul></ul>' 314 str += '</ul></ul>'
312 localtime = time.asctime(time.localtime(time.time())) 315 localtime = time.asctime(time.localtime(time.time()))
313 # TODO(imasaki): remove my name from here. 316 # TODO(imasaki): remove my name from here.
314 subject = 'Layout Test Analyzer Result (%s): %s' % (test_group_name, 317 subject = 'Layout Test Analyzer Result (%s): %s' % (test_group_name,
315 localtime) 318 localtime)
316 SendEmail('imasaki@chromium.org', 'Kenji Imasaki', 319 SendEmail('imasaki@chromium.org', 'Kenji Imasaki',
317 [receiver_email_address], ['Layout Test Analyzer Result'], subject, 320 [receiver_email_address], ['Layout Test Analyzer Result'], subject,
318 str) 321 str + appended_text_to_email)
319 322
320 323
321 def SendEmail(sender_email_address, sender_name, receivers_email_addresses, 324 def SendEmail(sender_email_address, sender_name, receivers_email_addresses,
322 receivers_names, subject, message): 325 receivers_names, subject, message):
323 """Send email using localhost's mail server. 326 """Send email using localhost's mail server.
324 327
325 Args: 328 Args:
326 sender_email_address: sender's email address. 329 sender_email_address: sender's email address.
327 sender_name: sender's name. 330 sender_name: sender's name.
328 receivers_email_addresses: receiver's email addresses. 331 receivers_email_addresses: receiver's email addresses.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 list2 = map2[name]['te_info'] 442 list2 = map2[name]['te_info']
440 te_diff = [item for item in list1 if not item in list2] 443 te_diff = [item for item in list1 if not item in list2]
441 if te_diff: 444 if te_diff:
442 name_list.append((name, te_diff)) 445 name_list.append((name, te_diff))
443 else: 446 else:
444 name_list.append((name, v1)) 447 name_list.append((name, v1))
445 return name_list 448 return name_list
446 449
447 return (GetDiffBetweenMapsHelper(map1, map2, lookIntoTestExpectationInfo), 450 return (GetDiffBetweenMapsHelper(map1, map2, lookIntoTestExpectationInfo),
448 GetDiffBetweenMapsHelper(map2, map1, lookIntoTestExpectationInfo)) 451 GetDiffBetweenMapsHelper(map2, map1, lookIntoTestExpectationInfo))
OLDNEW
« no previous file with comments | « media/tools/layout_tests/layouttest_analyzer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698