Title: [258261] trunk/Tools
Revision
258261
Author
[email protected]
Date
2020-03-11 07:47:19 -0700 (Wed, 11 Mar 2020)

Log Message

[ews] Add unit test to prevent multiple schedulers for a builder.
https://bugs.webkit.org/show_bug.cgi?id=208917

Reviewed by Carlos Alberto Lopez Perez.

* BuildSlaveSupport/ews-build/loadConfig_unittest.py:
(ConfigDotJSONTest.test_multiple_scheduers_for_builder): Added unit test.
(TagsForBuilderTest): Fixed a typo.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/ews-build/loadConfig_unittest.py (258260 => 258261)


--- trunk/Tools/BuildSlaveSupport/ews-build/loadConfig_unittest.py	2020-03-11 14:40:27 UTC (rev 258260)
+++ trunk/Tools/BuildSlaveSupport/ews-build/loadConfig_unittest.py	2020-03-11 14:47:19 UTC (rev 258261)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2018 Apple Inc. All rights reserved.
+# Copyright (C) 2018-2020 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -45,8 +45,17 @@
             for key in builder:
                 self.assertTrue(key in valid_builder_keys, 'Unexpected key "{}" for builder {}'.format(key, builder.get('name')))
 
+    def test_multiple_scheduers_for_builder(self):
+        cwd = os.path.dirname(os.path.abspath(__file__))
+        config = json.load(open(os.path.join(cwd, 'config.json')))
+        builder_to_schduler_map = {}
+        for scheduler in config.get('schedulers'):
+            for buildername in scheduler.get('builderNames'):
+                self.assertTrue(buildername not in builder_to_schduler_map, 'builder {} appears multiple times in schedulers.'.format(buildername))
+                builder_to_schduler_map[buildername] = scheduler.get('name')
 
-class TagsForBuilderTeest(unittest.TestCase):
+
+class TagsForBuilderTest(unittest.TestCase):
     def verifyTags(self, builderName, expectedTags):
         tags = loadConfig.getTagsForBuilder({'name': builderName})
         self.assertEqual(sorted(tags), sorted(expectedTags))

Modified: trunk/Tools/ChangeLog (258260 => 258261)


--- trunk/Tools/ChangeLog	2020-03-11 14:40:27 UTC (rev 258260)
+++ trunk/Tools/ChangeLog	2020-03-11 14:47:19 UTC (rev 258261)
@@ -1,3 +1,14 @@
+2020-03-11  Aakash Jain  <[email protected]>
+
+        [ews] Add unit test to prevent multiple schedulers for a builder.
+        https://bugs.webkit.org/show_bug.cgi?id=208917
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * BuildSlaveSupport/ews-build/loadConfig_unittest.py:
+        (ConfigDotJSONTest.test_multiple_scheduers_for_builder): Added unit test.
+        (TagsForBuilderTest): Fixed a typo.
+
 2020-03-11 Philippe Normand  <[email protected]>
 
         [GTK] Failing API tests under the Flatpak SDK environment
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to