Add support for remotes file for EWS builders
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Nov 2019 16:32:03 +0000 (16:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Nov 2019 16:32:03 +0000 (16:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=203899

Patch by Paulo Matos <pmatos@igalia.com> on 2019-11-07
Reviewed by Aakash Jain.

Require to support builders that cross-compile and run tests on native machines
through the use of --remote-config-file.

* BuildSlaveSupport/ews-build/factories.py:
(Factory.__init__):
(StyleFactory.__init__):
(WatchListFactory.__init__):
* BuildSlaveSupport/ews-build/loadConfig.py:
(loadBuilderConfig):
* BuildSlaveSupport/ews-build/steps.py:
(ConfigureBuild.__init__):
(ConfigureBuild.start):
(RunJavaScriptCoreTests.start):
* BuildSlaveSupport/ews-build/steps_unittest.py:
(TestRunJavaScriptCoreTests.test_remote_success):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252184 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/ews-build/factories.py
Tools/BuildSlaveSupport/ews-build/loadConfig.py
Tools/BuildSlaveSupport/ews-build/steps.py
Tools/BuildSlaveSupport/ews-build/steps_unittest.py
Tools/ChangeLog

index a16d2f0..6f26a33 100644 (file)
@@ -33,9 +33,9 @@ from steps import (ApplyPatch, ApplyWatchList, CheckOutSource, CheckOutSpecificR
 
 
 class Factory(factory.BuildFactory):
-    def __init__(self, platform, configuration=None, architectures=None, buildOnly=True, triggers=None, additionalArguments=None, checkRelevance=False, **kwargs):
+    def __init__(self, platform, configuration=None, architectures=None, buildOnly=True, triggers=None, remotes=None, additionalArguments=None, checkRelevance=False, **kwargs):
         factory.BuildFactory.__init__(self)
-        self.addStep(ConfigureBuild(platform, configuration, architectures, buildOnly, triggers, additionalArguments))
+        self.addStep(ConfigureBuild(platform, configuration, architectures, buildOnly, triggers, remotes, additionalArguments))
         if checkRelevance:
             self.addStep(CheckPatchRelevance())
         self.addStep(ValidatePatch())
@@ -49,9 +49,9 @@ class Factory(factory.BuildFactory):
 
 
 class StyleFactory(factory.BuildFactory):
-    def __init__(self, platform, configuration=None, architectures=None, triggers=None, additionalArguments=None, **kwargs):
+    def __init__(self, platform, configuration=None, architectures=None, triggers=None, remotes=None, additionalArguments=None, **kwargs):
         factory.BuildFactory.__init__(self)
-        self.addStep(ConfigureBuild(platform, configuration, architectures, False, triggers, additionalArguments))
+        self.addStep(ConfigureBuild(platform, configuration, architectures, False, triggers, remotes, additionalArguments))
         self.addStep(ValidatePatch())
         self.addStep(PrintConfiguration())
         self.addStep(CheckOutSource())
@@ -61,9 +61,9 @@ class StyleFactory(factory.BuildFactory):
 
 
 class WatchListFactory(factory.BuildFactory):
-    def __init__(self, platform, configuration=None, architectures=None, triggers=None, additionalArguments=None, **kwargs):
+    def __init__(self, platform, configuration=None, architectures=None, triggers=None, remotes=None, additionalArguments=None, **kwargs):
         factory.BuildFactory.__init__(self)
-        self.addStep(ConfigureBuild(platform, configuration, architectures, False, triggers, additionalArguments))
+        self.addStep(ConfigureBuild(platform, configuration, architectures, False, triggers, remotes, additionalArguments))
         self.addStep(ValidatePatch())
         self.addStep(PrintConfiguration())
         self.addStep(CheckOutSource())
index 6e14a43..721423a 100644 (file)
@@ -65,7 +65,7 @@ def loadBuilderConfig(c, is_test_mode_enabled=False, master_prefix_path='./'):
         if 'icon' in builder:
             del builder['icon']
         factorykwargs = {}
-        for key in ['platform', 'configuration', 'architectures', 'triggers', 'additionalArguments', 'runTests']:
+        for key in ['platform', 'configuration', 'architectures', 'triggers', 'remotes', 'additionalArguments', 'runTests']:
             value = builder.pop(key, None)
             if value:
                 factorykwargs[key] = value
index 6ca2015..b3b5565 100644 (file)
@@ -49,7 +49,7 @@ class ConfigureBuild(buildstep.BuildStep):
     description = ['configuring build']
     descriptionDone = ['Configured build']
 
-    def __init__(self, platform, configuration, architectures, buildOnly, triggers, additionalArguments):
+    def __init__(self, platform, configuration, architectures, buildOnly, triggers, remotes, additionalArguments):
         super(ConfigureBuild, self).__init__()
         self.platform = platform
         if platform != 'jsc-only':
@@ -59,6 +59,7 @@ class ConfigureBuild(buildstep.BuildStep):
         self.architecture = ' '.join(architectures) if architectures else None
         self.buildOnly = buildOnly
         self.triggers = triggers
+        self.remotes = remotes
         self.additionalArguments = additionalArguments
 
     def start(self):
@@ -74,6 +75,8 @@ class ConfigureBuild(buildstep.BuildStep):
             self.setProperty('buildOnly', self.buildOnly, 'config.json')
         if self.triggers:
             self.setProperty('triggers', self.triggers, 'config.json')
+        if self.remotes:
+            self.setProperty('remotes', self.remotes, 'config.json')
         if self.additionalArguments:
             self.setProperty('additionalArguments', self.additionalArguments, 'config.json')
 
@@ -932,6 +935,11 @@ class RunJavaScriptCoreTests(shell.Test):
         shell.Test.__init__(self, logEnviron=False, **kwargs)
 
     def start(self):
+        # add remotes configuration file path to the command line if needed
+        remotesfile = self.getProperty('remotes', False)
+        if remotesfile:
+            self.command.append('--remote-config-file={0}'.format(remotesfile))
+
         appendCustomBuildFlags(self, self.getProperty('platform'), self.getProperty('fullPlatform'))
         return shell.Test.start(self)
 
index 52aa47e..26595de 100644 (file)
@@ -1011,6 +1011,22 @@ class TestRunJavaScriptCoreTests(BuildStepMixinAdditions, unittest.TestCase):
         self.expectOutcome(result=SUCCESS, state_string='Passed JSC tests')
         return self.runStep()
 
+    def test_remote_success(self):
+        self.setupStep(RunJavaScriptCoreTests())
+        self.setProperty('fullPlatform', 'jsc-only')
+        self.setProperty('configuration', 'release')
+        self.setProperty('remotes', 'remote-machines.json')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        logEnviron=False,
+                        command=['perl', 'Tools/Scripts/run-javascriptcore-tests', '--no-build', '--no-fail-fast', '--json-output={0}'.format(self.jsonFileName), '--release', '--remote-config-file=remote-machines.json'],
+                        logfiles={'json': self.jsonFileName},
+                        )
+            + 0,
+        )
+        self.expectOutcome(result=SUCCESS, state_string='Passed JSC tests')
+        return self.runStep()
+
     def test_failure(self):
         self.setupStep(RunJavaScriptCoreTests())
         self.setProperty('fullPlatform', 'jsc-only')
index 6f1269b..9f10337 100644 (file)
@@ -1,3 +1,26 @@
+2019-11-07  Paulo Matos  <pmatos@igalia.com>
+
+        Add support for remotes file for EWS builders
+        https://bugs.webkit.org/show_bug.cgi?id=203899
+
+        Reviewed by Aakash Jain.
+
+        Require to support builders that cross-compile and run tests on native machines
+        through the use of --remote-config-file.
+
+        * BuildSlaveSupport/ews-build/factories.py:
+        (Factory.__init__):
+        (StyleFactory.__init__):
+        (WatchListFactory.__init__):
+        * BuildSlaveSupport/ews-build/loadConfig.py:
+        (loadBuilderConfig):
+        * BuildSlaveSupport/ews-build/steps.py:
+        (ConfigureBuild.__init__):
+        (ConfigureBuild.start):
+        (RunJavaScriptCoreTests.start):
+        * BuildSlaveSupport/ews-build/steps_unittest.py:
+        (TestRunJavaScriptCoreTests.test_remote_success):
+
 2019-11-06  Antti Koivisto  <antti@apple.com>
 
         REGRESSION: [ iOS ] ( r251015 ) Layout Test fast/text/whitespace/pre-wrap-overflow-selection.html is flaky