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

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

Issue 2829993002: webkitpy: Prevent the addition of duplicate virtual tests. (Closed)
Patch Set: Created 3 years, 8 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 | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
index dbcd2ea84e27ede9bf4da14685572fdb4457eeb5..af7038902338ecea0d3662fd27f5e82662023803 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -1481,7 +1481,12 @@ class Port(object):
assert self._filesystem.exists(path_to_virtual_test_suites), 'LayoutTests/VirtualTestSuites not found'
try:
test_suite_json = json.loads(self._filesystem.read_text_file(path_to_virtual_test_suites))
- self._virtual_test_suites = [VirtualTestSuite(**d) for d in test_suite_json]
+ self._virtual_test_suites = []
+ for json_config in test_suite_json:
+ vts = VirtualTestSuite(**json_config)
+ if vts in self._virtual_test_suites:
+ raise ValueError('LayoutTests/VirtualTestSuites contains duplicate definition: %r' % json_config)
+ self._virtual_test_suites.append(vts)
except ValueError as error:
raise ValueError('LayoutTests/VirtualTestSuites is not a valid JSON file: %s' % error)
return self._virtual_test_suites
@@ -1617,6 +1622,13 @@ class VirtualTestSuite(object):
def __repr__(self):
return "VirtualTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args)
+ def __eq__(self, other):
+ return (
+ self.name == other.name and
+ self.base == other.base and
+ self.args == other.args and
+ self.reference_args == other.reference_args)
+
class PhysicalTestSuite(object):
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698