OLD | NEW |
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 from datetime import datetime | 8 from datetime import datetime |
9 from email.mime.multipart import MIMEMultipart | 9 from email.mime.multipart import MIMEMultipart |
10 from email.mime.text import MIMEText | 10 from email.mime.text import MIMEText |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 Both are used as inputs for Google spreadsheet. | 139 Both are used as inputs for Google spreadsheet. |
140 | 140 |
141 Args: | 141 Args: |
142 current_time: a string depicting a time in year-month-day-hour | 142 current_time: a string depicting a time in year-month-day-hour |
143 format (e.g., 2011-11-08-16). | 143 format (e.g., 2011-11-08-16). |
144 | 144 |
145 Returns: | 145 Returns: |
146 a tuple of stats and issues_txt | 146 a tuple of stats and issues_txt |
147 stats: analyzer result in CSV format that shows: | 147 stats: analyzer result in CSV format that shows: |
148 (current_time, the number of tests, the number of skipped tests, | 148 (current_time, the number of tests, the number of skipped tests, |
149 the number of failing tests) | 149 the number of failing tests, passing rate) |
150 For example, | 150 For example, |
151 "2011-11-10-15,204,22,12" | 151 "2011-11-10-15,204,22,12,94" |
152 issues_txt: issues listed in CSV format that shows: | 152 issues_txt: issues listed in CSV format that shows: |
153 (BUGWK or BUGCR, bug number, the test expectation entry, | 153 (BUGWK or BUGCR, bug number, the test expectation entry, |
154 the name of the test) | 154 the name of the test) |
155 For example, | 155 For example, |
156 "BUGWK,71543,TIMEOUT PASS,media/media-element-play-after-eos.html, | 156 "BUGWK,71543,TIMEOUT PASS,media/media-element-play-after-eos.html, |
157 BUGCR,97657,IMAGE CPU MAC TIMEOUT PASS,media/audio-repaint.html," | 157 BUGCR,97657,IMAGE CPU MAC TIMEOUT PASS,media/audio-repaint.html," |
158 """ | 158 """ |
159 stats = ','.join([current_time, str(len(self.result_map['whole'].keys())), | 159 stats = ','.join([current_time, str(len(self.result_map['whole'].keys())), |
160 str(len(self.result_map['skip'].keys())), | 160 str(len(self.result_map['skip'].keys())), |
161 str(len(self.result_map['nonskip'].keys()))]) | 161 str(len(self.result_map['nonskip'].keys())), |
| 162 str(self.GetPassingRate())]) |
162 issues_txt = '' | 163 issues_txt = '' |
163 for bug_txt, test_info_list in ( | 164 for bug_txt, test_info_list in ( |
164 self.GetListOfBugsForNonSkippedTests().iteritems()): | 165 self.GetListOfBugsForNonSkippedTests().iteritems()): |
165 matches = re.match(r'(BUG(CR|WK))(\d+)', bug_txt) | 166 matches = re.match(r'(BUG(CR|WK))(\d+)', bug_txt) |
166 bug_suffix = '' | 167 bug_suffix = '' |
167 bug_no = '' | 168 bug_no = '' |
168 if matches: | 169 if matches: |
169 bug_suffix = matches.group(1) | 170 bug_suffix = matches.group(1) |
170 bug_no = matches.group(3) | 171 bug_no = matches.group(3) |
171 issues_txt += bug_suffix + ',' + bug_no + ',' | 172 issues_txt += bug_suffix + ',' + bug_no + ',' |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 list2 = map2[name]['te_info'] | 547 list2 = map2[name]['te_info'] |
547 te_diff = [item for item in list1 if not item in list2] | 548 te_diff = [item for item in list1 if not item in list2] |
548 if te_diff: | 549 if te_diff: |
549 name_list.append((name, te_diff)) | 550 name_list.append((name, te_diff)) |
550 else: | 551 else: |
551 name_list.append((name, value1)) | 552 name_list.append((name, value1)) |
552 return name_list | 553 return name_list |
553 | 554 |
554 return (GetDiffBetweenMapsHelper(map1, map2, lookIntoTestExpectationInfo), | 555 return (GetDiffBetweenMapsHelper(map1, map2, lookIntoTestExpectationInfo), |
555 GetDiffBetweenMapsHelper(map2, map1, lookIntoTestExpectationInfo)) | 556 GetDiffBetweenMapsHelper(map2, map1, lookIntoTestExpectationInfo)) |
OLD | NEW |