Title: [234397] trunk/Tools
Revision
234397
Author
[email protected]
Date
2018-07-30 16:29:13 -0700 (Mon, 30 Jul 2018)

Log Message

[ews-build] Add support for API tests in OpenSource EWS
https://bugs.webkit.org/show_bug.cgi?id=188156

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/config.json:
* BuildSlaveSupport/ews-build/factories.py:
(BuildFactory.__init__): Added triggers parameter.
(BuildFactory): If trigger is defined, create and upload archive and trigger appropriate queues.
(BuildFactory.propertiesToPassToTriggers): Pass all the required properties to triggered queue.
(APITestsFactory): Factory for running API tests.
* BuildSlaveSupport/ews-build/steps.py:
(ConfigureBuild.start): Set the property only if property is defined in config.json. Also set the 
source of the property.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/ews-build/config.json (234396 => 234397)


--- trunk/Tools/BuildSlaveSupport/ews-build/config.json	2018-07-30 23:23:40 UTC (rev 234396)
+++ trunk/Tools/BuildSlaveSupport/ews-build/config.json	2018-07-30 23:29:13 UTC (rev 234397)
@@ -204,6 +204,7 @@
       "platform": "ios-simulator-11",
       "configuration": "release",
       "architectures": ["x86_64"],
+      "triggers": ["api-tests-ios-sim-ews"],
       "workernames": ["ews123", "ews124", "ews125", "ews126"]
     },
     {
@@ -212,6 +213,7 @@
       "platform": "mac-sierra",
       "configuration": "release",
       "architectures": ["x86_64"],
+      "triggers": ["api-tests-mac-ews"],
       "workernames": ["ews100", "ews101", "ews102", "ews103"]
     },
     {
@@ -280,6 +282,18 @@
       "factory": "WebKitPerlFactory",
       "platform": "*",
       "workernames": ["webkit-misc"]
+    },
+    {
+      "name": "API-Tests-iOS-Simulator-EWS",
+      "factory": "APITestsFactory",
+      "platform": "*",
+      "workernames": ["webkit-misc"]
+    },
+    {
+      "name": "API-Tests-macOS-EWS",
+      "factory": "APITestsFactory",
+      "platform": "*",
+      "workernames": ["webkit-misc"]
     }
   ],
   "schedulers": [
@@ -290,6 +304,20 @@
       "builderNames": ["Style-EWS", "JSC-Tests-EWS", "macOS-Sierra-Release-WK1-EWS", "GTK-Webkit2-EWS", "macOS-Sierra-Release-WK2-EWS",
                        "macOS-High-Sierra-Release-32bit-WK2-EWS", "WPE-EWS", "Windows-EWS", "iOS-11-EWS", "WinCairo-EWS", "iOS-11-Simulator-EWS",
                        "WebKitPy-Tests-EWS", "WebKitPerl-Tests-EWS", "macOS-Sierra-Debug-WK1-EWS", "Bindings-tests-EWS"]
+    },
+    {
+      "type": "Triggerable",
+      "name": "api-tests-ios-sim-ews",
+      "builderNames": [
+        "API-Tests-iOS-Simulator-EWS"
+      ]     
+    },
+    {
+      "type": "Triggerable",
+      "name": "api-tests-mac-ews",
+      "builderNames": [
+        "API-Tests-macOS-EWS"
+      ]     
     }
   ]
 }

Modified: trunk/Tools/BuildSlaveSupport/ews-build/factories.py (234396 => 234397)


--- trunk/Tools/BuildSlaveSupport/ews-build/factories.py	2018-07-30 23:23:40 UTC (rev 234396)
+++ trunk/Tools/BuildSlaveSupport/ews-build/factories.py	2018-07-30 23:29:13 UTC (rev 234397)
@@ -21,11 +21,14 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-from buildbot.process import factory
+from buildbot.process import factory, properties
+from buildbot.steps import trigger
 
 from steps import *
 
+Property = properties.Property
 
+
 class Factory(factory.BuildFactory):
     def __init__(self, platform, configuration=None, architectures=None, buildOnly=True, additionalArguments=None, **kwargs):
         factory.BuildFactory.__init__(self)
@@ -58,7 +61,7 @@
 
 
 class BuildFactory(Factory):
-    def __init__(self, platform, configuration=None, architectures=None, additionalArguments=None, **kwargs):
+    def __init__(self, platform, configuration=None, architectures=None, additionalArguments=None, triggers=None, **kwargs):
         Factory.__init__(self, platform, configuration, architectures, False, additionalArguments)
         self.addStep(KillOldProcesses())
         self.addStep(CleanBuild())
@@ -65,8 +68,21 @@
         self.addStep(CompileWebKit())
         self.addStep(UnApplyPatchIfRequired())
         self.addStep(CompileWebKitToT())
+        if triggers:
+            self.addStep(ArchiveBuiltProduct())
+            self.addStep(UploadBuiltProduct())
+            self.addStep(trigger.Trigger(schedulerNames=triggers, set_properties=self.propertiesToPassToTriggers() or {}))
 
+    def propertiesToPassToTriggers(self):
+        return {
+            "ewspatchid": Property("ewspatchid"),
+            "configuration": Property("configuration"),
+            "platform": Property("platform"),
+            "fullPlatform": Property("fullPlatform"),
+            "architecture": Property("architecture"),
+        }
 
+
 class JSCTestsFactory(Factory):
     def __init__(self, platform, configuration='release', architectures=None, additionalArguments=None, **kwargs):
         Factory.__init__(self, platform, configuration, architectures, False, additionalArguments)
@@ -79,6 +95,17 @@
         self.addStep(RunJavaScriptCoreTestsToT())
 
 
+class APITestsFactory(Factory):
+    def getProduct(self):
+        self.addStep(DownloadBuiltProduct())
+        self.addStep(ExtractBuiltProduct())
+
+    def __init__(self, platform, configuration=None, architectures=None, additionalArguments=None, **kwargs):
+        Factory.__init__(self, platform, configuration, architectures, False, additionalArguments)
+        self.getProduct()
+        self.addStep(RunAPITests())
+
+
 class GTKFactory(Factory):
     pass
 
@@ -88,8 +115,8 @@
 
 
 class iOSSimulatorFactory(BuildFactory):
-    def __init__(self, platform, configuration=None, architectures=None, additionalArguments=None, **kwargs):
-        BuildFactory.__init__(self, platform, configuration, architectures, additionalArguments)
+    def __init__(self, platform, configuration=None, architectures=None, additionalArguments=None, triggers=None, **kwargs):
+        BuildFactory.__init__(self, platform, configuration, architectures, additionalArguments, triggers)
         self.addStep(RunWebKitTests())
 
 

Modified: trunk/Tools/BuildSlaveSupport/ews-build/steps.py (234396 => 234397)


--- trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2018-07-30 23:23:40 UTC (rev 234396)
+++ trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2018-07-30 23:29:13 UTC (rev 234397)
@@ -49,12 +49,18 @@
         self.additionalArguments = additionalArguments
 
     def start(self):
-        self.setProperty("platform", self.platform)
-        self.setProperty("fullPlatform", self.fullPlatform)
-        self.setProperty("configuration", self.configuration)
-        self.setProperty("architecture", self.architecture)
-        self.setProperty("buildOnly", self.buildOnly)
-        self.setProperty("additionalArguments", self.additionalArguments)
+        if self.platform and self.platform != '*':
+            self.setProperty('platform', self.platform, 'config.json')
+        if self.fullPlatform and self.fullPlatform != '*':
+            self.setProperty('fullPlatform', self.fullPlatform, 'ConfigureBuild')
+        if self.configuration:
+            self.setProperty('configuration', self.configuration, 'config.json')
+        if self.architecture:
+            self.setProperty('architecture', self.architecture, 'config.json')
+        if self.buildOnly:
+            self.setProperty("buildOnly", self.buildOnly, 'config.json')
+        if self.additionalArguments:
+            self.setProperty("additionalArguments", self.additionalArguments, 'config.json')
         self.finished(SUCCESS)
         return defer.succeed(None)
 

Modified: trunk/Tools/ChangeLog (234396 => 234397)


--- trunk/Tools/ChangeLog	2018-07-30 23:23:40 UTC (rev 234396)
+++ trunk/Tools/ChangeLog	2018-07-30 23:29:13 UTC (rev 234397)
@@ -1,3 +1,20 @@
+2018-07-30 Aakash Jain  <[email protected]>
+
+        [ews-build] Add support for API tests in OpenSource EWS
+        https://bugs.webkit.org/show_bug.cgi?id=188156
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-build/config.json:
+        * BuildSlaveSupport/ews-build/factories.py:
+        (BuildFactory.__init__): Added triggers parameter.
+        (BuildFactory): If trigger is defined, create and upload archive and trigger appropriate queues.
+        (BuildFactory.propertiesToPassToTriggers): Pass all the required properties to triggered queue.
+        (APITestsFactory): Factory for running API tests.
+        * BuildSlaveSupport/ews-build/steps.py:
+        (ConfigureBuild.start): Set the property only if property is defined in config.json. Also set the 
+        source of the property.
+
 2018-07-30  Aakash Jain  <[email protected]>
 
         [ews-build] loadConfig should ensure that the triggers are valid
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to