Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py

Issue 2455233002: Use Port.skips_test in copy-existing-baselines command. (Closed)
Patch Set: For copying existing baselines, continue skipping if test is skipped in generic expectations. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 return self._webkit_finder.perf_tests_dir() 923 return self._webkit_finder.perf_tests_dir()
924 924
925 def skipped_layout_tests(self, test_list): 925 def skipped_layout_tests(self, test_list):
926 """Returns tests skipped outside of the TestExpectations files.""" 926 """Returns tests skipped outside of the TestExpectations files."""
927 return set(self._skipped_tests_for_unsupported_features(test_list)) 927 return set(self._skipped_tests_for_unsupported_features(test_list))
928 928
929 def skips_test(self, test, generic_expectations, full_expectations): 929 def skips_test(self, test, generic_expectations, full_expectations):
930 """Checks whether the given test is skipped for this port. 930 """Checks whether the given test is skipped for this port.
931 931
932 This should return True if the test is skipped because the port 932 This should return True if the test is skipped because the port
933 runs smoke tests only, or because there's a skip test expectation line. 933 runs smoke tests only, or because the
chenwilliam 2016/10/31 22:49:29 I think this patch truncated the comment on accide
qyearsley 2016/10/31 23:05:21 Good catch, thanks! I'll fix this in a follow-up.
934 """ 934 """
935 fs = self.host.filesystem 935 fs = self.host.filesystem
936 if self.default_smoke_test_only(): 936 if self.default_smoke_test_only():
937 smoke_test_filename = fs.join(self.layout_tests_dir(), 'SmokeTests') 937 smoke_test_filename = fs.join(self.layout_tests_dir(), 'SmokeTests')
938 if fs.exists(smoke_test_filename) and test not in fs.read_text_file( smoke_test_filename): 938 if fs.exists(smoke_test_filename) and test not in fs.read_text_file( smoke_test_filename):
939 return True 939 return True
940 940
941 # In general, Skip lines in the generic expectations file indicate
942 # that the test is temporarily skipped, whereas if the test is skipped
943 # in another file (e.g. WontFix in NeverFixTests), then the test may
944 # always be skipped for this port.
945 # TODO(qyearsley): Simplify this so that it doesn't rely on having
946 # two copies of the test expectations.
941 return (SKIP in full_expectations.get_expectations(test) and 947 return (SKIP in full_expectations.get_expectations(test) and
942 SKIP not in generic_expectations.get_expectations(test)) 948 SKIP not in generic_expectations.get_expectations(test))
943 949
944 def _tests_from_skipped_file_contents(self, skipped_file_contents): 950 def _tests_from_skipped_file_contents(self, skipped_file_contents):
945 tests_to_skip = [] 951 tests_to_skip = []
946 for line in skipped_file_contents.split('\n'): 952 for line in skipped_file_contents.split('\n'):
947 line = line.strip() 953 line = line.strip()
948 line = line.rstrip('/') # Best to normalize directory names to not include the trailing slash. 954 line = line.rstrip('/') # Best to normalize directory names to not include the trailing slash.
949 if line.startswith('#') or not len(line): 955 if line.startswith('#') or not len(line):
950 continue 956 continue
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1838 1844
1839 def __init__(self, base, args, reference_args=None): 1845 def __init__(self, base, args, reference_args=None):
1840 self.name = base 1846 self.name = base
1841 self.base = base 1847 self.base = base
1842 self.args = args 1848 self.args = args
1843 self.reference_args = args if reference_args is None else reference_args 1849 self.reference_args = args if reference_args is None else reference_args
1844 self.tests = set() 1850 self.tests = set()
1845 1851
1846 def __repr__(self): 1852 def __repr__(self):
1847 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args) 1853 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698