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

Unified Diff: tools/testrunner/local/statusfile.py

Issue 1477403002: [test+presubmit] Remove duplicate test status file entries (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/presubmit.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testrunner/local/statusfile.py
diff --git a/tools/testrunner/local/statusfile.py b/tools/testrunner/local/statusfile.py
index 6e2a012a9aa0795a0f1a1a812fbc5dfaaead0185..f86106b9d9cf8e2073e9c8ff123be7aad1649bc8 100644
--- a/tools/testrunner/local/statusfile.py
+++ b/tools/testrunner/local/statusfile.py
@@ -156,20 +156,25 @@ def ReadStatusFile(path, variables):
def PresubmitCheck(path):
contents = ReadContent(path)
root_prefix = os.path.basename(os.path.dirname(path)) + "/"
-
+ status = {"success": True}
+ def _assert(check, message): # Like "assert", but doesn't throw.
+ if not check:
+ print("%s: Error: %s" % (path, message))
+ status["success"] = False
try:
for section in contents:
- assert type(section) == list
- assert len(section) == 2
+ _assert(type(section) == list, "Section must be a list")
+ _assert(len(section) == 2, "Section list must have exactly 2 entries")
section = section[1]
- assert type(section) == dict
+ _assert(type(section) == dict,
+ "Second entry of section must be a dictionary")
for rule in section:
- assert type(rule) == str
- assert not rule.startswith(root_prefix), (
- "Suite name prefix must not be used in status files")
- assert not rule.endswith('.js'), (
- ".js extension must not be used in status files.")
- return True
+ _assert(type(rule) == str, "Rule key must be a string")
+ _assert(not rule.startswith(root_prefix),
+ "Suite name prefix must not be used in rule keys")
+ _assert(not rule.endswith('.js'),
+ ".js extension must not be used in rule keys.")
+ return status["success"]
except Exception as e:
print e
return False
« no previous file with comments | « tools/presubmit.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698