Add support for using localhost worker in OpenSource EWS Buildbot
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2018 18:42:28 +0000 (18:42 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2018 18:42:28 +0000 (18:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186871

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/loadConfig.py:
(loadBuilderConfig): Added a worker named 'local-worker' if use_localhost_worker option is used.
* BuildSlaveSupport/ews-build/master.cfg: Check BUILDBOT_TESTING environment variable and use_localhost_worker if so.

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

Tools/BuildSlaveSupport/ews-build/loadConfig.py
Tools/BuildSlaveSupport/ews-build/master.cfg
Tools/ChangeLog

index 2be6006..f42e62e 100644 (file)
@@ -35,12 +35,15 @@ BUILDER_NAME_LENGTH_LIMIT = 70
 STEP_NAME_LENGTH_LIMIT = 50
 
 
-def loadBuilderConfig(c):
+def loadBuilderConfig(c, use_localhost_worker=False):
     config = json.load(open('config.json'))
     passwords = json.load(open('passwords.json'))
     checkWorkersAndBuildersForConsistency(config['workers'], config['builders'])
 
     c['workers'] = [Worker(worker['name'], passwords.get(worker['name'], 'password')) for worker in config['workers']]
+    if use_localhost_worker:
+        c['workers'].append(Worker('local-worker', 'password', max_builds=2))
+
     c['builders'] = []
     for builder in config['builders']:
         builder['tags'] = getTagsForBuilder(builder)
@@ -49,6 +52,10 @@ def loadBuilderConfig(c):
         del builder['platform']
         if 'configuration' in builder:
             del builder['configuration']
+
+        if use_localhost_worker:
+            builder['workernames'].append("local-worker")
+
         c['builders'].append(builder)
 
     c['schedulers'] = []
index b1c35c9..b7a1cde 100644 (file)
@@ -1,6 +1,10 @@
+import os
+
 import loadConfig
 
 
+is_test_mode_enabled = os.getenv('BUILDBOT_TESTING') is not None
+
 c = BuildmasterConfig = {}
 
 c['www'] = dict(port=8010,
@@ -20,4 +24,4 @@ c['buildbotURL'] = 'https://ews-build.webkit.org/'
 
 c['buildbotNetUsageData'] = None
 
-loadConfig.loadBuilderConfig(c)
+loadConfig.loadBuilderConfig(c, use_localhost_worker=is_test_mode_enabled)
index 1047252..8fb6885 100644 (file)
@@ -1,5 +1,16 @@
 2018-06-21  Aakash Jain  <aakash_jain@apple.com>
 
+        Add support for using localhost worker in OpenSource EWS Buildbot
+        https://bugs.webkit.org/show_bug.cgi?id=186871
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-build/loadConfig.py:
+        (loadBuilderConfig): Added a worker named 'local-worker' if use_localhost_worker option is used.
+        * BuildSlaveSupport/ews-build/master.cfg: Check BUILDBOT_TESTING environment variable and use_localhost_worker if so.
+
+2018-06-21  Aakash Jain  <aakash_jain@apple.com>
+
         Add force schedulers to OpenSource EWS Buildbot
         https://bugs.webkit.org/show_bug.cgi?id=186876