OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Helper functions for the layout test analyzer.""" | 5 """Helper functions for the layout test analyzer.""" |
6 | 6 |
7 from datetime import datetime | 7 from datetime import datetime |
8 from email.mime.multipart import MIMEMultipart | 8 from email.mime.multipart import MIMEMultipart |
9 from email.mime.text import MIMEText | 9 from email.mime.text import MIMEText |
10 import fileinput | 10 import fileinput |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 if issue_detail_mode: | 224 if issue_detail_mode: |
225 return_str += '<b>Current issues about failing non-skipped tests:</b>' | 225 return_str += '<b>Current issues about failing non-skipped tests:</b>' |
226 for (bug_txt, test_info_list) in ( | 226 for (bug_txt, test_info_list) in ( |
227 self.GetListOfBugsForNonSkippedTests().iteritems()): | 227 self.GetListOfBugsForNonSkippedTests().iteritems()): |
228 return_str += '<ul>%s' % Bug(bug_txt) | 228 return_str += '<ul>%s' % Bug(bug_txt) |
229 for test_info in test_info_list: | 229 for test_info in test_info_list: |
230 (test_name, te_info) = test_info | 230 (test_name, te_info) = test_info |
231 gpu_link = '' | 231 gpu_link = '' |
232 if 'GPU' in te_info: | 232 if 'GPU' in te_info: |
233 gpu_link = 'group=%40ToT%20GPU%20Mesa%20-%20chromium.org&' | 233 gpu_link = 'group=%40ToT%20GPU%20Mesa%20-%20chromium.org&' |
234 dashboard_link = ('http://test-results.appspot.com/dashboards/' | 234 dashboard_link = ('https://test-results.appspot.com/dashboards/' |
235 'flakiness_dashboard.html#%stests=%s') % ( | 235 'flakiness_dashboard.html#%stests=%s') % ( |
236 gpu_link, test_name) | 236 gpu_link, test_name) |
237 return_str += '<li><a href="%s">%s</a> (%s) </li>' % ( | 237 return_str += '<li><a href="%s">%s</a> (%s) </li>' % ( |
238 dashboard_link, test_name, ' '.join( | 238 dashboard_link, test_name, ' '.join( |
239 [key for key in te_info.keys() if key != 'Platforms'])) | 239 [key for key in te_info.keys() if key != 'Platforms'])) |
240 return_str += '</ul>\n' | 240 return_str += '</ul>\n' |
241 return return_str | 241 return return_str |
242 | 242 |
243 def CompareToOtherResultMap(self, other_result_map): | 243 def CompareToOtherResultMap(self, other_result_map): |
244 """Compare this result map with the other to see if there are any diff. | 244 """Compare this result map with the other to see if there are any diff. |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 for line in target_lines: | 423 for line in target_lines: |
424 # Find *.html pattern (test name) and replace it with the link to | 424 # Find *.html pattern (test name) and replace it with the link to |
425 # flakiness dashboard. | 425 # flakiness dashboard. |
426 test_name_pattern = r'(\S+.html)' | 426 test_name_pattern = r'(\S+.html)' |
427 match = re.search(test_name_pattern, line) | 427 match = re.search(test_name_pattern, line) |
428 if match: | 428 if match: |
429 test_name = match.group(1) | 429 test_name = match.group(1) |
430 gpu_link = '' | 430 gpu_link = '' |
431 if 'GPU' in line: | 431 if 'GPU' in line: |
432 gpu_link = 'group=%40ToT%20GPU%20Mesa%20-%20chromium.org&' | 432 gpu_link = 'group=%40ToT%20GPU%20Mesa%20-%20chromium.org&' |
433 dashboard_link = ('http://test-results.appspot.com/dashboards/' | 433 dashboard_link = ('https://test-results.appspot.com/dashboards/' |
434 'flakiness_dashboard.html#%stests=%s') % ( | 434 'flakiness_dashboard.html#%stests=%s') % ( |
435 gpu_link, test_name) | 435 gpu_link, test_name) |
436 line = line.replace(test_name, '<a href="%s">%s</a>' % ( | 436 line = line.replace(test_name, '<a href="%s">%s</a>' % ( |
437 dashboard_link, test_name)) | 437 dashboard_link, test_name)) |
438 # Find bug text and replace it with the link to the bug. | 438 # Find bug text and replace it with the link to the bug. |
439 bug = Bug(line) | 439 bug = Bug(line) |
440 if bug.bug_txt: | 440 if bug.bug_txt: |
441 line = '<li>%s</li>\n' % line.replace(bug.bug_txt, str(bug)) | 441 line = '<li>%s</li>\n' % line.replace(bug.bug_txt, str(bug)) |
442 rev_str += line | 442 rev_str += line |
443 rev_str += '</ul></ul>' | 443 rev_str += '</ul></ul>' |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 list2 = map2[name]['te_info'] | 586 list2 = map2[name]['te_info'] |
587 te_diff = [item for item in list1 if not item in list2] | 587 te_diff = [item for item in list1 if not item in list2] |
588 if te_diff: | 588 if te_diff: |
589 name_list.append((name, te_diff)) | 589 name_list.append((name, te_diff)) |
590 else: | 590 else: |
591 name_list.append((name, value1)) | 591 name_list.append((name, value1)) |
592 return name_list | 592 return name_list |
593 | 593 |
594 return (GetDiffBetweenMapsHelper(map1, map2, lookIntoTestExpectationInfo), | 594 return (GetDiffBetweenMapsHelper(map1, map2, lookIntoTestExpectationInfo), |
595 GetDiffBetweenMapsHelper(map2, map1, lookIntoTestExpectationInfo)) | 595 GetDiffBetweenMapsHelper(map2, map1, lookIntoTestExpectationInfo)) |
OLD | NEW |