diff options
author | imasaki@google.com <imasaki@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-05 03:59:08 +0000 |
---|---|---|
committer | imasaki@google.com <imasaki@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-05 03:59:08 +0000 |
commit | 48aed0bc64c7c628c13663b885ae05648a3b19c3 (patch) | |
tree | d457772d6aa95ed87b924d6db2de10f7012816a1 /media | |
parent | 0b5847613b590cfd093ab20ecbb2d87d11d4674c (diff) | |
download | chromium_src-48aed0bc64c7c628c13663b885ae05648a3b19c3.zip chromium_src-48aed0bc64c7c628c13663b885ae05648a3b19c3.tar.gz chromium_src-48aed0bc64c7c628c13663b885ae05648a3b19c3.tar.bz2 |
Adding bug information in the dashboard in the layout test analyzer.
Review URL: http://codereview.chromium.org/8142019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/tools/layout_tests/layouttest_analyzer.py | 34 | ||||
-rw-r--r-- | media/tools/layout_tests/layouttest_analyzer_helpers.py | 11 | ||||
-rw-r--r-- | media/tools/layout_tests/layouttest_analyzer_runner.py | 3 |
3 files changed, 34 insertions, 14 deletions
diff --git a/media/tools/layout_tests/layouttest_analyzer.py b/media/tools/layout_tests/layouttest_analyzer.py index 65f183b..7d6ae2a 100644 --- a/media/tools/layout_tests/layouttest_analyzer.py +++ b/media/tools/layout_tests/layouttest_analyzer.py @@ -240,9 +240,12 @@ def SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, the email. rev: the latest revision number for the given test group. rev_date: the latest revision date for the given test group. + email_content: email content string (without + |appended_text_to_email|) that will be shown on the dashboard. """ rev = '' rev_date = '' + email_content = '' if prev_analyzer_result_map: diff_map = analyzer_result_map.CompareToOtherResultMap( prev_analyzer_result_map) @@ -264,11 +267,13 @@ def SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, layouttest_analyzer_helpers.GetRevisionString(prev_time_in_float, cur_time_in_float, diff_map)) + email_content = analyzer_result_map.ConvertToString(prev_time, diff_map, + anno_map) if receiver_email_address: layouttest_analyzer_helpers.SendStatusEmail( prev_time, analyzer_result_map, diff_map, anno_map, receiver_email_address, test_group_name, - appended_text_to_email, rev_str) + appended_text_to_email, email_content, rev_str) if simple_rev_str: simple_rev_str = '\'' + simple_rev_str + '\'' else: @@ -279,7 +284,8 @@ def SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, result_change = True diff_map = None simple_rev_str = 'undefined' - return (result_change, diff_map, simple_rev_str, rev, rev_date) + return (result_change, diff_map, simple_rev_str, rev, rev_date, + email_content) def UpdateTrendGraph(start_time, analyzer_result_map, diff_map, simple_rev_str, @@ -360,7 +366,8 @@ def UpdateTrendGraph(start_time, analyzer_result_map, diff_map, simple_rev_str, def UpdateDashboard(dashboard_file_location, test_group_name, data_map, - layouttest_root_path, rev, rev_date, email): + layouttest_root_path, rev, rev_date, email, + email_content): """Update dashboard HTML file. Args: @@ -376,6 +383,8 @@ def UpdateDashboard(dashboard_file_location, test_group_name, data_map, rev: the latest revision number for the given test group. rev_date: the latest revision date for the given test group. email: email address of the owner for the given test group. + email_content: email content string (without |appended_text_to_email|) + that will be shown on the dashboard. """ # Generate a HTML file that contains all test names for each test group. escaped_tg_name = test_group_name.replace('/', '_') @@ -397,11 +406,21 @@ def UpdateDashboard(dashboard_file_location, test_group_name, data_map, data_map[tg][0][testname])) file_object.write('</table>') file_object.close() + email_content_with_link = '' + if email_content: + file_name = os.path.join(os.path.dirname(dashboard_file_location), + escaped_tg_name + '_email.html') + file_object = open(file_name, 'wb') + file_object.write(email_content) + file_object.close() + email_content_with_link = '<a href="%s_email.html">info</a>' % ( + escaped_tg_name) new_str = ('<td><a href="%s">%s</a></td><td><a href="%s">%s</a></td>' '<td><a href="%s">%s</a></td><td><a href="%s">%s</a></td>' '<td><a href="%s">%s</a></td><td>%d%%</td><td>%s%%</td>' '<td><a href="http://trac.webkit.org/changeset/%s">%s</a></td>' - '<td>%s</td><td><a href="mailto:%s">%s</a></td>\n') % ( + '<td>%s</td><td><a href="mailto:%s">%s</a></td>' + '<td>%s</td>\n') % ( # Dashboard file and graph must be in the same directory # to make the following link work. layouttest_root_path + '/' + test_group_name, @@ -412,7 +431,7 @@ def UpdateDashboard(dashboard_file_location, test_group_name, data_map, len(data_map['nonskip'][0]), 100 - int(data_map['passingrate'][0]), data_map['passingrate'][0], rev, rev, rev_date, email, - email) + email, email_content_with_link) layouttest_analyzer_helpers.ReplaceLineInFile( dashboard_file_location, '<td>' + test_group_name + '</td>', new_str) @@ -430,7 +449,7 @@ def main(): (anno_map, appended_text_to_email) = ReadEmailInformation( options.bug_annotation_file_location, options.email_appended_text_file_location) - (result_change, diff_map, simple_rev_str, rev, rev_date) = ( + (result_change, diff_map, simple_rev_str, rev, rev_date, email_content) = ( SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, anno_map, appended_text_to_email, options.email_only_change_mode, options.debug, @@ -448,7 +467,8 @@ def main(): if options.dashboard_file_location: UpdateDashboard(options.dashboard_file_location, options.test_group_name, data_map, layouttests.DEFAULT_LAYOUTTEST_LOCATION, rev, - rev_date, options.receiver_email_address) + rev_date, options.receiver_email_address, + email_content) if '__main__' == __name__: diff --git a/media/tools/layout_tests/layouttest_analyzer_helpers.py b/media/tools/layout_tests/layouttest_analyzer_helpers.py index 534a13c..44d4496 100644 --- a/media/tools/layout_tests/layouttest_analyzer_helpers.py +++ b/media/tools/layout_tests/layouttest_analyzer_helpers.py @@ -255,7 +255,7 @@ class AnalyzerResultMap: def SendStatusEmail(prev_time, analyzer_result_map, diff_map, bug_anno_map, receiver_email_address, test_group_name, - appended_text_to_email, rev_str): + appended_text_to_email, email_content, rev_str): """Send status email. Args: @@ -281,21 +281,20 @@ def SendStatusEmail(prev_time, analyzer_result_map, diff_map, test_group_name: string representing the test group name (e.g., 'media'). appended_text_to_email: a text which is appended at the end of the status email. + email_content: an email content string that will be shown on the dashboard. rev_str: a revision string that contains revision information that is sent out in the status email. It is obtained by calling |GetRevisionString()|. """ - output_str = analyzer_result_map.ConvertToString(prev_time, diff_map, - bug_anno_map) if rev_str: - output_str += '<br><b>Revision Information:</b>' - output_str += rev_str + email_content += '<br><b>Revision Information:</b>' + email_content += rev_str localtime = time.asctime(time.localtime(time.time())) # TODO(imasaki): remove my name from here. subject = 'Layout Test Analyzer Result (%s): %s' % (test_group_name, localtime) SendEmail('imasaki@chromium.org', [receiver_email_address], - subject, output_str + appended_text_to_email) + subject, email_content + appended_text_to_email) def GetRevisionString(prev_time, current_time, diff_map): diff --git a/media/tools/layout_tests/layouttest_analyzer_runner.py b/media/tools/layout_tests/layouttest_analyzer_runner.py index 8b00a97..bb0966b 100644 --- a/media/tools/layout_tests/layouttest_analyzer_runner.py +++ b/media/tools/layout_tests/layouttest_analyzer_runner.py @@ -122,7 +122,8 @@ test expectation file and were not skipped. file_object.write('<th>Passing Rate</th>') file_object.write('<th>Last Revision Number</th>') file_object.write('<th>Last Revision Date</th>') - file_object.write('<th>Owner Email</th></tr>\n') + file_object.write('<th>Owner Email</th>') + file_object.write('<th>Bug Information</th></tr>\n') test_group_list.sort() for i, test_group in enumerate(test_group_list): file_object.write('<tr class="d' + str(i % 2) + '">\n') |