本文整理汇总了Python中webkitpy.common.webkit_finder.WebKitFinder.path_to_script方法的典型用法代码示例。如果您正苦于以下问题:Python WebKitFinder.path_to_script方法的具体用法?Python WebKitFinder.path_to_script怎么用?Python WebKitFinder.path_to_script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webkitpy.common.webkit_finder.WebKitFinder
的用法示例。
在下文中一共展示了WebKitFinder.path_to_script方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: W3CExpectationsLineAdder
# 需要导入模块: from webkitpy.common.webkit_finder import WebKitFinder [as 别名]
# 或者: from webkitpy.common.webkit_finder.WebKitFinder import path_to_script [as 别名]
#.........这里部分代码省略.........
if marker_comment_index == -1:
file_contents += '\n%s\n' % MARKER_COMMENT
file_contents += '\n'.join(line_list)
else:
end_of_marker_line = (file_contents[marker_comment_index:].find('\n')) + marker_comment_index
file_contents = file_contents[:end_of_marker_line + 1] + '\n'.join(line_list) + file_contents[end_of_marker_line:]
self.host.filesystem.write_text_file(expectations_file_path, file_contents)
@staticmethod
def _test_name_from_expectation_string(expectation_string):
return TestExpectationLine.tokenize_line(filename='', expectation_string=expectation_string, line_number=0).name
def get_expected_txt_files(self, tests_results):
"""Fetches new baseline files for tests that should be rebaselined.
Invokes webkit-patch rebaseline-from-try-jobs in order to download new
-expected.txt files for testharness.js tests that did not crash or time
out. Then, the platform-specific test is removed from the overall
failure test dictionary.
Args:
tests_results: A dict mapping test name to platform to test results.
Returns:
An updated tests_results dictionary without the platform-specific
testharness.js tests that required new baselines to be downloaded
from `webkit-patch rebaseline-from-try-jobs`.
"""
modified_tests = self.get_modified_existing_tests()
tests_to_rebaseline, tests_results = self.get_tests_to_rebaseline(modified_tests, tests_results)
_log.debug('Tests to rebaseline: %r', tests_to_rebaseline)
if tests_to_rebaseline:
webkit_patch = self.host.filesystem.join(
self.finder.chromium_base(), self.finder.webkit_base(), self.finder.path_to_script('webkit-patch'))
self.host.executive.run_command([
'python',
webkit_patch,
'rebaseline-cl',
'--verbose',
'--no-trigger-jobs',
] + tests_to_rebaseline)
return tests_results
def get_modified_existing_tests(self):
"""Returns a list of layout test names for layout tests that have been modified."""
diff_output = self.host.executive.run_command(
['git', 'diff', 'origin/master', '--name-only', '--diff-filter=AMR']) # Added, modified, and renamed files.
paths_from_chromium_root = diff_output.splitlines()
modified_tests = []
for path in paths_from_chromium_root:
absolute_path = self.host.filesystem.join(self.finder.chromium_base(), path)
if not self.host.filesystem.exists(absolute_path):
_log.warning('File does not exist: %s', absolute_path)
continue
test_path = self.finder.layout_test_name(path)
if test_path:
modified_tests.append(test_path)
return modified_tests
def get_tests_to_rebaseline(self, modified_tests, test_results):
"""Returns a list of tests to download new baselines for.
Creates a list of tests to rebaseline depending on the tests' platform-
specific results. In general, this will be non-ref tests that failed
due to a baseline mismatch (rather than crash or timeout).