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

Unified Diff: third_party/WebKit/LayoutTests/PRESUBMIT.py

Issue 2006963002: Reland of In LayoutTests PRESUBMIT, Don't check for all-pass baseline files in platform and virtual. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include all original changes + new fix Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/PRESUBMIT.py
diff --git a/third_party/WebKit/LayoutTests/PRESUBMIT.py b/third_party/WebKit/LayoutTests/PRESUBMIT.py
index 14239542734289bb7ffdb972492f6a80d9de8aae..c6566a7e22eb61667d7c59ae3d7ccb4c3ff4a677 100644
--- a/third_party/WebKit/LayoutTests/PRESUBMIT.py
+++ b/third_party/WebKit/LayoutTests/PRESUBMIT.py
@@ -12,15 +12,20 @@ import filecmp
def _CheckTestharnessResults(input_api, output_api):
- expected_files = [f.AbsoluteLocalPath() for f in input_api.AffectedFiles() if f.LocalPath().endswith('-expected.txt') and f.Action() != 'D']
- if len(expected_files) == 0:
+ """Checks for testharness.js test baseline files that contain only PASS lines.
+
+ In general these files are unnecessary because for testharness.js tests, if there is
+ no baseline file then the test is considered to pass when the output is all PASS.
+ """
+ baseline_files = _TestharnessBaselineFilesToCheck(input_api)
+ if not baseline_files:
return []
checker_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
'..', 'Tools', 'Scripts', 'check-testharness-expected-pass')
args = [input_api.python_executable, checker_path]
- args.extend(expected_files)
+ args.extend(baseline_files)
_, errs = input_api.subprocess.Popen(args,
stdout=input_api.subprocess.PIPE,
stderr=input_api.subprocess.PIPE).communicate()
@@ -29,6 +34,27 @@ def _CheckTestharnessResults(input_api, output_api):
return []
+def _TestharnessBaselineFilesToCheck(input_api):
+ """Returns a list of paths of -expected.txt files for testharness.js tests."""
+ baseline_files = []
+ for f in input_api.AffectedFiles():
+ if f.Action() == 'D':
+ continue
+ path = f.AbsoluteLocalPath()
+ if not path.endswith('-expected.txt'):
+ continue
+ if (input_api.os_path.join('LayoutTests', 'platform') in path or
+ input_api.os_path.join('LayoutTests', 'virtual') in path):
+ # We want to ignore files in LayoutTests/platform, because some all-PASS
+ # platform specific baselines may be necessary to prevent fallback to a
+ # more general baseline; we also ignore files in LayoutTests/virtual
+ # for a similar reason; some all-pass baselines are necessary to
+ # prevent fallback to the corresponding non-virtual test baseline.
+ continue
+ baseline_files.append(path)
+ return baseline_files
+
+
def _CheckIdenticalFiles(input_api, output_api):
"""Verifies that certain files are identical in various locations.
These files should always be updated together."""
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698