diff options
Diffstat (limited to 'media')
-rw-r--r-- | media/tools/layout_tests/anno/media.csv | 6 | ||||
-rw-r--r-- | media/tools/layout_tests/bug.py | 47 | ||||
-rwxr-xr-x | media/tools/layout_tests/layouttest_analyzer.py | 135 | ||||
-rw-r--r-- | media/tools/layout_tests/layouttest_analyzer_helpers.py | 30 | ||||
-rwxr-xr-x | media/tools/layout_tests/layouttest_analyzer_runner.py | 64 | ||||
-rw-r--r-- | media/tools/layout_tests/layouttests.py | 84 | ||||
-rw-r--r-- | media/tools/layout_tests/runner_config/runner_config.csv | 46 | ||||
-rw-r--r-- | media/tools/layout_tests/test_expectations.py | 5 | ||||
-rw-r--r-- | media/tools/layout_tests/testname/media.csv | 1 |
9 files changed, 131 insertions, 287 deletions
diff --git a/media/tools/layout_tests/anno/media.csv b/media/tools/layout_tests/anno/media.csv deleted file mode 100644 index 3447857..0000000 --- a/media/tools/layout_tests/anno/media.csv +++ /dev/null @@ -1,6 +0,0 @@ -BUGCR86714,Pinging anne@ -BUGCR74102,Should create new issue and update the test expectation file -BUGWK55718,Should create new issue and update the test expectation file -BUGCR59415,BLOCKED - Cannot repro the timeout -BUGCR72223,depends on http://crbug.com/73609 -BUGCR75354,Rebaseline should be done by imasaki@ http://crbug.com/87144 diff --git a/media/tools/layout_tests/bug.py b/media/tools/layout_tests/bug.py index 42dd17d..d8cd20a 100644 --- a/media/tools/layout_tests/bug.py +++ b/media/tools/layout_tests/bug.py @@ -6,6 +6,8 @@ import re +from webkitpy.layout_tests.models.test_expectations import * + class Bug(object): """A class representing a bug. @@ -13,8 +15,6 @@ class Bug(object): TODO(imasaki): add more functionalities here if bug-tracker API is available. For example, you can get the name of a bug owner. """ - CHROME_BUG_URL = 'http://crbug.com/' - WEBKIT_BUG_URL = 'http://webkit.org/b/' # Type enum for the bug. WEBKIT = 0 CHROMIUM = 1 @@ -27,33 +27,30 @@ class Bug(object): Args: bug_modifier: a string representing a bug modifier. According to - http://trac.webkit.org/wiki/TestExpectations#Modifiers, - currently, BUGWK12345, BUGCR12345, BUGV8_12345, BUGDPRANKE are - possible. + http://www.chromium.org/developers/testing/webkit-layout-tests/\ + testexpectations + Bug identifiers are of the form "webkit.org/b/12345", "crbug.com/12345", + "code.google.com/p/v8/issues/detail?id=12345" or "Bug(username)" """ - pattern_for_webkit_bug = r'(BUGWK(\d+))' - match = re.search(pattern_for_webkit_bug, bug_modifier) - if match: - self.type = self.WEBKIT - self.url = self.WEBKIT_BUG_URL + match.group(2) - self.bug_txt = match.group(1) - return - pattern_for_chrome_bug = r'(BUGCR(\d+))' - match = re.search(pattern_for_chrome_bug, bug_modifier) - if match: - self.type = self.CHROMIUM - self.url = self.CHROME_BUG_URL + match.group(2) - self.bug_txt = match.group(1) - return - pattern_for_other_bug = r'(BUG(\S+))' - match = re.search(pattern_for_other_bug, bug_modifier) + match = re.match('Bug\((\w+)\)$', bug_modifier) if match: self.type = self.OTHERS - self.url = 'mailto:%s@chromium.org' % match.group(2).lower() - self.bug_txt = match.group(1) + self.url = 'mailto:%s@chromium.org' % match.group(1).lower() + self.bug_txt = bug_modifier return - self.url = '' - self.bug_txt = '' + + self.type = self.GetBugType(bug_modifier) + self.url = bug_modifier + self.bug_txt = bug_modifier + + + def GetBugType(self, bug_modifier): + """Returns type of the bug based on URL.""" + if bug_modifier.startswith(WEBKIT_BUG_PREFIX): + return self.WEBKIT; + if bug_modifier.startswith(CHROMIUM_BUG_PREFIX): + return self.CHROMIUM; + return self.OTHERS def __str__(self): """Get a string representation of a bug object. diff --git a/media/tools/layout_tests/layouttest_analyzer.py b/media/tools/layout_tests/layouttest_analyzer.py index 412092a..7459a97 100755 --- a/media/tools/layout_tests/layouttest_analyzer.py +++ b/media/tools/layout_tests/layouttest_analyzer.py @@ -5,7 +5,6 @@ """Main functions for the Layout Test Analyzer module.""" -import csv from datetime import datetime import optparse import os @@ -13,23 +12,34 @@ import sys import time import layouttest_analyzer_helpers +from layouttest_analyzer_helpers import DEFAULT_REVISION_VIEW_URL import layouttests +from layouttests import DEFAULT_LAYOUTTEST_SVN_VIEW_LOCATION from test_expectations import TestExpectations from trend_graph import TrendGraph # Predefined result directory. DEFAULT_RESULT_DIR = 'result' -DEFAULT_ANNO_FILE = os.path.join('anno', 'anno.csv') +# TODO(shadi): Remove graph functions as they are not used any more. DEFAULT_GRAPH_FILE = os.path.join('graph', 'graph.html') +# TODO(shadi): Check if these files are needed any more. DEFAULT_STATS_CSV_FILENAME = 'stats.csv' DEFAULT_ISSUES_CSV_FILENAME = 'issues.csv' +# TODO(shadi): These are used only for |debug| mode. What is debug mode for? +# AFAIK, we don't run debug mode, should be safe to remove. # Predefined result files for debug. CUR_TIME_FOR_DEBUG = '2011-09-11-19' CURRENT_RESULT_FILE_FOR_DEBUG = os.path.join(DEFAULT_RESULT_DIR, CUR_TIME_FOR_DEBUG) PREV_TIME_FOR_DEBUG = '2011-09-11-18' +# Text to append at the end of every analyzer result email. +DEFAULT_EMAIL_APPEND_TEXT = ( + '<b><a href="https://groups.google.com/a/google.com/group/' + 'layout-test-analyzer-result/topics">Email History</a></b><br>' + ) + def ParseOption(): """Parse command-line options using OptionParser. @@ -57,12 +67,6 @@ def ParseOption(): 'Visualization API trend-line format ' '(defaults to %default).'), default=DEFAULT_GRAPH_FILE) - option_parser.add_option('-a', '--bug-anno-file-location', - dest='bug_annotation_file_location', - help=('Location of the bug annotation file; ' - 'file is expected to be in CSV format ' - '(default to %default).'), - default=DEFAULT_ANNO_FILE) option_parser.add_option('-n', '--test-group-file-location', dest='test_group_file_location', help=('Location of the test group file; ' @@ -115,7 +119,7 @@ def GetCurrentAndPreviousResults(debug, test_group_file_location, """Get current and the latest previous analyzer results. In debug mode, they are read from predefined files. In non-debug mode, - current analyzer results are dynamically obtained from Webkit SVN and + current analyzer results are dynamically obtained from Blink SVN and the latest previous result is read from the corresponding file. Args: @@ -148,7 +152,7 @@ def GetCurrentAndPreviousResults(debug, test_group_file_location, # When test group CSV file is not specified, test group name # (e.g., 'media') is used for getting layout tests. # The tests are in - # http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media + # http://src.chromium.org/blink/trunk/LayoutTests/media # Filtering is not set so all HTML files are considered as valid tests. # Also, we look for the tests recursively. if not test_group_file_location or ( @@ -183,47 +187,8 @@ def GetCurrentAndPreviousResults(debug, test_group_file_location, return (prev_time, prev_analyzer_result_map, analyzer_result_map) -def ReadEmailInformation(bug_annotation_file_location, - email_appended_text_file_location): - """Read bug annotations and generate an annotation map used for email. - - Args: - bug_annotation_file_location: please refer to |options|. - email_appended_text_file_location: please refer to |options|. - - Returns: - a tuple of the following: - anno_map: a dictionary that maps bug names to their annotations. - appended_text_to_email: the text string to append to the status email. - """ - anno_map = {} - try: - file_object = open(bug_annotation_file_location) - except IOError: - print 'cannot open annotation file %s. Skipping.' % ( - bug_annotation_file_location) - else: - data = csv.reader(file_object) - for row in data: - if len(row) > 1: - anno_map[row[0]] = row[1] - file_object.close() - - appended_text_to_email = '' - if email_appended_text_file_location: - try: - file_object = open(email_appended_text_file_location) - except IOError: - print 'cannot open email appended text file %s. Skipping.' % ( - email_appended_text_file_location) - else: - appended_text_to_email = ''.join(file_object.readlines()) - file_object.close() - return (anno_map, appended_text_to_email) - - def SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, - anno_map, appended_text_to_email, email_only_change_mode, debug, + appended_text_to_email, email_only_change_mode, debug, receiver_email_address, test_group_name, issue_detail_mode): """Send result status email. @@ -233,7 +198,6 @@ def SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, layouttest_analyzer_helpers.AnalyzerResultMap. analyzer_result_map: current analyzer result map. Please refer to layouttest_analyzer_helpers.AnalyzerResultMap. - anno_map: a dictionary that maps bug names to their annotations. appended_text_to_email: the text string to append to the status email. email_only_change_mode: please refer to |options|. debug: please refer to |options|. @@ -280,11 +244,10 @@ def SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, diff_map)) email_content = analyzer_result_map.ConvertToString(prev_time, diff_map, - anno_map, issue_detail_mode) if receiver_email_address: layouttest_analyzer_helpers.SendStatusEmail( - prev_time, analyzer_result_map, diff_map, anno_map, + prev_time, analyzer_result_map, diff_map, receiver_email_address, test_group_name, appended_text_to_email, email_content, rev_str, email_only_change_mode) @@ -299,7 +262,6 @@ def SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, diff_map = None simple_rev_str = 'undefined' email_content = analyzer_result_map.ConvertToString(None, diff_map, - anno_map, issue_detail_mode) return (result_change, diff_map, simple_rev_str, rev, rev_date, email_content) @@ -358,9 +320,9 @@ def UpdateTrendGraph(start_time, analyzer_result_map, diff_map, simple_rev_str, for i in [0, 1]: for (name, _) in diff_map[test_group][i]: test_str += name + ',' - # This is link to test HTML in WebKit SVN. - links += ('<a href="http://trac.webkit.org/browser/trunk/' - 'LayoutTests/%s">%s</a>,') % (name, name) + # This is link to test HTML in SVN. + links += ('<a href="%s%s">%s</a>' % + (DEFAULT_LAYOUTTEST_SVN_VIEW_LOCATION, name, name)) if test_str: anno = '\'' + test_str + '\'' # The annotation of passing rate is a union of all annotations. @@ -395,8 +357,7 @@ def UpdateDashboard(dashboard_file_location, test_group_name, data_map, test name to its description, annotation, simple_rev_string) of the given result data category. These tuples are used for trend graph update. - layouttest_root_path: A location string where Webkit layout tests are - stored. + layouttest_root_path: A location string where layout tests are stored. 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. @@ -432,25 +393,40 @@ def UpdateDashboard(dashboard_file_location, test_group_name, data_map, 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>' - '<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, - test_group_name, escaped_tg_name + '.html', - 'graph', escaped_tg_name + '_whole.html', - len(data_map['whole'][0]), escaped_tg_name + '_skip.html', - len(data_map['skip'][0]), escaped_tg_name + '_nonskip.html', - len(data_map['nonskip'][0]), - 100 - int(data_map['passingrate'][0]), - data_map['passingrate'][0], rev, rev, rev_date, email, - email, email_content_with_link) + test_group_str = ( + '<td><a href="%(test_group_path)s">%(test_group_name)s</a></td>' + '<td><a href="%(graph_path)s">graph</a></td>' + '<td><a href="%(all_tests_path)s">%(all_tests_count)d</a></td>' + '<td><a href="%(skip_tests_path)s">%(skip_tests_count)d</a></td>' + '<td><a href="%(nonskip_tests_path)s">%(nonskip_tests_count)d</a></td>' + '<td>%(fail_rate)d%%</td>' + '<td>%(passing_rate)d%%</td>' + '<td><a href="%(rev_url)s">%(rev)s</a></td>' + '<td>%(rev_date)s</td>' + '<td><a href="mailto:%(email)s">%(email)s</a></td>' + '<td>%(email_content)s</td>\n') % { + # Dashboard file and graph must be in the same directory + # to make the following link work. + 'test_group_path': layouttest_root_path + '/' + test_group_name, + 'test_group_name': test_group_name, + 'graph_path': escaped_tg_name + '.html', + 'all_tests_path': escaped_tg_name + '_whole.html', + 'all_tests_count': len(data_map['whole'][0]), + 'skip_tests_path': escaped_tg_name + '_skip.html', + 'skip_tests_count': len(data_map['skip'][0]), + 'nonskip_tests_path': escaped_tg_name + '_nonskip.html', + 'nonskip_tests_count': len(data_map['nonskip'][0]), + 'fail_rate': 100 - int(data_map['passingrate'][0]), + 'passing_rate': int(data_map['passingrate'][0]), + 'rev_url': DEFAULT_REVISION_VIEW_URL % rev, + 'rev': rev, + 'rev_date': rev_date, + 'email': email, + 'email_content': email_content_with_link + } layouttest_analyzer_helpers.ReplaceLineInFile( - dashboard_file_location, '<td>' + test_group_name + '</td>', new_str) + dashboard_file_location, '<td>' + test_group_name + '</td>', + test_group_str) def main(): @@ -463,12 +439,9 @@ def main(): options.test_group_file_location, options.test_group_name, options.result_directory_location)) - (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, email_content) = ( SendEmail(prev_time, prev_analyzer_result_map, analyzer_result_map, - anno_map, appended_text_to_email, + DEFAULT_EMAIL_APPEND_TEXT, options.email_only_change_mode, options.debug, options.receiver_email_address, options.test_group_name, options.issue_detail_mode)) diff --git a/media/tools/layout_tests/layouttest_analyzer_helpers.py b/media/tools/layout_tests/layouttest_analyzer_helpers.py index cbcf79c..2eb3c15 100644 --- a/media/tools/layout_tests/layouttest_analyzer_helpers.py +++ b/media/tools/layout_tests/layouttest_analyzer_helpers.py @@ -15,15 +15,17 @@ import smtplib import socket import sys import time -import urllib from bug import Bug from test_expectations_history import TestExpectationsHistory -DEFAULT_TEST_EXPECTATION_PATH = ('trunk/LayoutTests/platform/chromium/' - 'TestExpectations') -LEGACY_DEFAULT_TEST_EXPECTATION_PATH = ('trunk/LayoutTests/platform/chromium/' - 'test_expectations.txt') +DEFAULT_TEST_EXPECTATION_PATH = ('trunk/LayoutTests/TestExpectations') +LEGACY_DEFAULT_TEST_EXPECTATION_PATH = ( + 'trunk/LayoutTests/platform/chromium/test_expectations.txt') +REVISION_LOG_URL = ('http://build.chromium.org/f/chromium/perf/dashboard/ui/' + 'changelog_blink.html?url=/trunk/LayoutTests/%s&range=%d:%d') +DEFAULT_REVISION_VIEW_URL = 'http://src.chromium.org/viewvc/blink?revision=%s' + class AnalyzerResultMap: """A class to deal with joined result produed by the analyzer. @@ -193,15 +195,12 @@ class AnalyzerResultMap: issues_txt += '\n' return stats, issues_txt - def ConvertToString(self, prev_time, diff_map, bug_anno_map, - issue_detail_mode): + def ConvertToString(self, prev_time, diff_map, issue_detail_mode): """Convert this result to HTML display for email. Args: prev_time: the previous time string that are compared against. diff_map: the compared map generated by |CompareResultMaps()|. - bug_anno_map: a annotation map where keys are bug names and values are - annotations for the bug. issue_detail_mode: includes the issue details in the output string if this is True. @@ -227,11 +226,7 @@ class AnalyzerResultMap: return_str += '<b>Current issues about failing non-skipped tests:</b>' for (bug_txt, test_info_list) in ( self.GetListOfBugsForNonSkippedTests().iteritems()): - if not bug_txt in bug_anno_map: - bug_anno_map[bug_txt] = '' - else: - bug_anno_map[bug_txt] = '(' + bug_anno_map[bug_txt] + ')' - return_str += '<ul>%s %s' % (Bug(bug_txt), bug_anno_map[bug_txt]) + return_str += '<ul>%s' % Bug(bug_txt) for test_info in test_info_list: (test_name, te_info) = test_info gpu_link = '' @@ -324,7 +319,7 @@ class AnalyzerResultMap: def SendStatusEmail(prev_time, analyzer_result_map, diff_map, - bug_anno_map, receiver_email_address, test_group_name, + receiver_email_address, test_group_name, appended_text_to_email, email_content, rev_str, email_only_change_mode): """Send status email. @@ -346,8 +341,6 @@ def SendStatusEmail(prev_time, analyzer_result_map, diff_map, This means that current result has 'foo1.html' but it is NOT in the previous result. This also means the previous result has 'foo2.html' but it is NOT in the current result. - bug_anno_map: bug annotation map where bug name and annotations are - stored. receiver_email_address: receiver's email address. 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 @@ -423,8 +416,7 @@ def GetRevisionString(prev_time, current_time, diff_map): if old_rev < 119317: old_path = LEGACY_DEFAULT_TEST_EXPECTATION_PATH - link = 'http://trac.webkit.org/changeset?new=%d@%s&old=%d@%s' % (new_rev, - new_path, old_rev, old_path) + link = REVISION_LOG_URL % (new_path, old_rev, new_rev) rev_str += '<ul><a href="%s">%s->%s</a>\n' % (link, old_rev, new_rev) simple_rev_str = '<a href="%s">%s->%s</a>,' % (link, old_rev, new_rev) rev_str += '<li>%s</li>\n' % author diff --git a/media/tools/layout_tests/layouttest_analyzer_runner.py b/media/tools/layout_tests/layouttest_analyzer_runner.py index eec0f4d..90a7100 100755 --- a/media/tools/layout_tests/layouttest_analyzer_runner.py +++ b/media/tools/layout_tests/layouttest_analyzer_runner.py @@ -11,20 +11,20 @@ on https://sites.google.com/a/chromium.org/dev/developers/testing/ webkit-layout-tests/layout-test-stats-1. """ -import csv import optparse import os import shutil from subprocess import Popen -import sys -DEFAULT_RUNNER_CONFIG_FILE = os.path.join('runner_config', - 'runner_config.csv') +# TODO(shadi): Re-examine the need of external files. Inline data instead? +DEFAULT_RUN_CONFIG = { + # test_group_name: ('test_files.csv', 'report_email_address') + 'media': ('testname/media.csv', 'layout-test-analyzer-result@google.com') +} # Predefined result/graph directory. DEFAULT_RESULT_DIR = 'result' DEFAULT_GRAPH_DIR = 'graph' -DEFAULT_ANNO_DIR = 'anno' def ParseOption(): @@ -34,16 +34,6 @@ def ParseOption(): an object containing all command-line option information. """ option_parser = optparse.OptionParser() - - option_parser.add_option('-c', '--runner-config-file-location', - dest='runner_config_file_location', - help=('Location of the bug annotation file; ' - 'file is expected to be in CSV format ' - '(default to %default)'), - default=DEFAULT_RUNNER_CONFIG_FILE) - option_parser.add_option('-x', '--test-group-name', - dest='test_group_name', - help='A name of test group.') option_parser.add_option('-d', '--result-directory-location', dest='result_directory_location', help=('Name of result directory location ' @@ -54,20 +44,6 @@ def ParseOption(): help=('Name of graph directory location ' '(default to %default)'), default=DEFAULT_GRAPH_DIR) - option_parser.add_option('-a', '--anno-directory-location', - dest='annotation_directory_location', - help=('Name of annotation directory location; ' - 'each annotation file should be the same ' - 'as test group name with replacement of "/"' - 'with "_" (default to %default)'), - default=DEFAULT_ANNO_DIR) - option_parser.add_option('-b', '--email-appended-text-file-location', - dest='email_appended_text_file_location', - help=('File location of the email appended text. ' - 'The text is appended in the status email. ' - '(default to %default and no text is ' - 'appended in that case.)'), - default=None) option_parser.add_option('-e', '--email-only-change-mode', dest='email_only_change_mode', help=('With this mode, email is sent out ' @@ -146,26 +122,13 @@ test expectation file and were not skipped. file_object.close() +# TODO(shadi): Use only one file with main()! Remove this file in favor of +# layouttest_analyzer.py main(). def main(): """A main function for the analyzer runner.""" options = ParseOption() - run_config_map = {} - try: - file_object = open(options.runner_config_file_location) - except IOError: - print 'cannot open runner configuration file %s. Exiting.' % ( - options.runner_config_file_location) - sys.exit() - data = csv.reader(file_object) - # Skip the first row since it is a comment/header line. - data.next() - for row in data: - run_config_map[row[0]] = (row[1], row[2]) - file_object.close() - if options.test_group_name: - test_group_list = [options.test_group_name] - else: - test_group_list = run_config_map.keys() + run_config_map = DEFAULT_RUN_CONFIG + test_group_list = run_config_map.keys() dashboard_file_location = os.path.join(options.graph_directory_location, 'index.html') if not os.path.exists(dashboard_file_location): @@ -186,18 +149,13 @@ def main(): shutil.copy(os.path.join('graph', 'graph.html'), graph_file) os.chmod(graph_file, 0744) - anno_file = os.path.join(options.annotation_directory_location, - test_group_name_for_data + '.csv') cmd = ('python layouttest_analyzer.py -x %s -d %s -t %s' - ' -q %s -a %s ') % ( - test_group, result_dir, graph_file, dashboard_file_location, - anno_file) + ' -q %s ') % ( + test_group, result_dir, graph_file, dashboard_file_location) if run_config_map[test_group][0]: cmd += '-n ' + run_config_map[test_group][0] + ' ' if run_config_map[test_group][1]: cmd += '-r ' + run_config_map[test_group][1] + ' ' - if options.email_appended_text_file_location: - cmd += ' -b ' + options.email_appended_text_file_location if options.email_only_change_mode: cmd += ' -c ' if options.issue_detail_mode: diff --git a/media/tools/layout_tests/layouttests.py b/media/tools/layout_tests/layouttests.py index 9811c22..8d30038 100644 --- a/media/tools/layout_tests/layouttests.py +++ b/media/tools/layout_tests/layouttests.py @@ -4,8 +4,8 @@ """Layout tests module that is necessary for the layout analyzer. -Layout tests are stored in Webkit SVN and LayoutTestCaseManager collects these -layout test cases (including description). +Layout tests are stored in an SVN repository and LayoutTestCaseManager collects +these layout test cases (including description). """ import copy @@ -17,9 +17,13 @@ import urllib2 import pysvn -# Webkit SVN root location. +# LayoutTests SVN root location. DEFAULT_LAYOUTTEST_LOCATION = ( - 'http://svn.webkit.org/repository/webkit/trunk/LayoutTests/') + 'http://src.chromium.org/blink/trunk/LayoutTests/') +# LayoutTests SVN view link +DEFAULT_LAYOUTTEST_SVN_VIEW_LOCATION = ( + 'http://src.chromium.org/viewvc/blink/trunk/LayoutTests/') + # When parsing the test HTML file and finding the test description, # this script tries to find the test description using sentences @@ -40,7 +44,7 @@ class LayoutTests(object): """A class to store test names in layout tests. The test names (including regular expression patterns) are read from a CSV - file and used for getting layout test names from Webkit SVN. + file and used for getting layout test names from repository. """ def __init__(self, layouttest_root_path=DEFAULT_LAYOUTTEST_LOCATION, @@ -49,8 +53,7 @@ class LayoutTests(object): """Initialize LayoutTests using root and CSV file. Args: - layouttest_root_path: A location string where Webkit layout tests are - stored. + layouttest_root_path: A location string where layout tests are stored. parent_location_list: A list of parent directories that are needed for getting layout tests. filter_names: A list of test name patterns that are used for filtering @@ -79,7 +82,7 @@ class LayoutTests(object): del self.name_map[lt_name] # We get description only for the filtered names. for lt_name in self.name_map.iterkeys(): - self.name_map[lt_name] = LayoutTests.GetTestDescriptionFromSVN(lt_name) + self.name_map[lt_name] = 'No description available' @staticmethod def ExtractTestDescription(txt): @@ -145,12 +148,12 @@ class LayoutTests(object): @staticmethod def GetLayoutTestNamesFromSVN(parent_location_list, layouttest_root_path, recursion): - """Get LayoutTest names from Webkit SVN. + """Get LayoutTest names from SVN. Args: parent_location_list: a list of locations of parent directories. This is used when getting layout tests using PySVN.list(). - layouttest_root_path: the root path of the Webkit SVN directory. + layouttest_root_path: the root path of layout tests directory. recursion: a boolean indicating whether the test names are sought recursively. @@ -158,22 +161,25 @@ class LayoutTests(object): a map containing test names as keys for de-dupe. """ client = pysvn.Client() - # Get directory structure in the Webkit SVN. + # Get directory structure in the repository SVN. name_map = {} for parent_location in parent_location_list: if parent_location.endswith('/'): - file_list = client.list(layouttest_root_path + parent_location, - recurse=recursion) - for file_name in file_list: - if sys.stdout.isatty(): - default_encoding = sys.stdout.encoding - else: - default_encoding = locale.getpreferredencoding() - file_name = file_name[0].repos_path.encode(default_encoding) - # Remove the word '/truck/LayoutTests'. - file_name = file_name.replace('/trunk/LayoutTests/', '') - if file_name.endswith('.html'): - name_map[file_name] = True + full_path = layouttest_root_path + parent_location + try: + file_list = client.list(full_path, recurse=recursion) + for file_name in file_list: + if sys.stdout.isatty(): + default_encoding = sys.stdout.encoding + else: + default_encoding = locale.getpreferredencoding() + file_name = file_name[0].repos_path.encode(default_encoding) + # Remove the word '/truck/LayoutTests'. + file_name = file_name.replace('/trunk/LayoutTests/', '') + if file_name.endswith('.html'): + name_map[file_name] = True + except: + print 'Unable to list tests in %s.' % full_path return name_map @staticmethod @@ -236,35 +242,3 @@ class LayoutTests(object): test_info_map[lt_name]['te_info'] = te_info break return test_info_map - - @staticmethod - def GetTestDescriptionFromSVN(test_location, - root_path=DEFAULT_LAYOUTTEST_LOCATION): - """Get test description of a layout test from SVN. - - Using urllib2.urlopen(), this method gets the entire HTML and extracts its - test description using |ExtractTestDescription()|. - - Args: - test_location: the location of the layout test. - root_path: the root path of the Webkit SVN directory. - - Returns: - A test description string. Returns an empty string is returned if the - test description cannot be extracted. - - Raises: - A URLError when the layout test is not available. - """ - if test_location.endswith('.html'): - url = root_path + test_location - try: - resp = urllib2.urlopen(url) - except urllib2.HTTPError: - # Some files with different languages cause this exception. - # Return an empty description in this case. - return '' - if resp.code == 200: - return LayoutTests.ExtractTestDescription(resp.read()) - raise urllib2.URLError( - 'Fail to get layout test HTML file from %s.' % url) diff --git a/media/tools/layout_tests/runner_config/runner_config.csv b/media/tools/layout_tests/runner_config/runner_config.csv deleted file mode 100644 index 5d118c9..0000000 --- a/media/tools/layout_tests/runner_config/runner_config.csv +++ /dev/null @@ -1,46 +0,0 @@ -test group name, test name configuration file location, contact person name -animations,, -canvas,, -compositing,, -css2.1,, -css3,, -editing,, -fast/backgrounds,, -fast/borders,, -fast/canvas,, -fast/css,, -fast/dom,, -fast/encoding,, -fast/flexbox,, -fast/forms,, -fast/frames,, -fast/html,, -fast/images,, -fast/js,, -fast/loader,, -fast/multicol,, -fast/overflow,, -fast/parser,, -fast/repaint,, -fast/speech,, -fast/table,, -fast/text,, -fast/transforms,, -fast/xsl,, -fonts,, -http/tests/appcache,, -http/tests/inspector,, -http/tests/misc,, -http/tests/navigation,, -http/tests/websocket,, -inspector,, -jquery,, -loader,, -media,testname/media.csv,imasaki@chromium.org -platform/chromium/compositing,, -platform/chromium/fast,, -plugins,, -scrollbars,, -svg,, -tables,, -transforms,, diff --git a/media/tools/layout_tests/test_expectations.py b/media/tools/layout_tests/test_expectations.py index 410c724..58b21de 100644 --- a/media/tools/layout_tests/test_expectations.py +++ b/media/tools/layout_tests/test_expectations.py @@ -102,7 +102,10 @@ class TestExpectations(object): remaining_modifiers = list(parsed.modifiers) test_expectation_info['Bugs'] = [] for m in parsed.modifiers: - if m.startswith('BUG'): + if (m.startswith(WEBKIT_BUG_PREFIX) or + m.startswith(CHROMIUM_BUG_PREFIX) or + m.startswith(V8_BUG_PREFIX) or + m.startswith(NAMED_BUG_PREFIX)): test_expectation_info['Bugs'].append(m) remaining_modifiers.remove(m) elif m in KNOWN_TE_KEYWORDS: diff --git a/media/tools/layout_tests/testname/media.csv b/media/tools/layout_tests/testname/media.csv index 264e7aa..50569d2 100644 --- a/media/tools/layout_tests/testname/media.csv +++ b/media/tools/layout_tests/testname/media.csv @@ -23,4 +23,3 @@ http/tests/security/\S*video\S+.html, http/tests/security/contentSecurityPolicy/media-src-allowed.html, http/tests/security/contentSecurityPolicy/media-src-blocked.html, media/, -platform/chromium/media/, |