Title: [272681] trunk/Tools
Revision
272681
Author
aakash_j...@apple.com
Date
2021-02-10 13:06:30 -0800 (Wed, 10 Feb 2021)

Log Message

[build.webkit.org] Remove code specific to old Buildbot
https://bugs.webkit.org/show_bug.cgi?id=221558

Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/buildbot.tac:
* CISupport/build-webkit-org/loadConfig.py:
* CISupport/build-webkit-org/loadConfig_unittest.py:
* CISupport/build-webkit-org/master.cfg: Removed.
* CISupport/build-webkit-org/steps.py:
(TestWithFailureCount.getText): Deleted.
(TestWithFailureCount.getText2): Deleted.
(CompileWebKit.createSummary): Deleted.
(RunWebKitTests._parseRunWebKitTestsOutput): Deleted.
(RunWebKitTests.commandComplete): Deleted.
(RunWebKitTests.getText): Deleted.
(RunWebKitTests.getText2): Deleted.
(ExtractTestResults.start): Deleted.
* CISupport/ews-build/steps.py:
* CISupport/ews-build/steps_unittest.py:

Modified Paths

Removed Paths

Diff

Modified: trunk/Tools/CISupport/build-webkit-org/buildbot.tac (272680 => 272681)


--- trunk/Tools/CISupport/build-webkit-org/buildbot.tac	2021-02-10 21:04:13 UTC (rev 272680)
+++ trunk/Tools/CISupport/build-webkit-org/buildbot.tac	2021-02-10 21:06:30 UTC (rev 272681)
@@ -1,15 +1,10 @@
 import os
 
-USE_BUILDBOT_VERSION2 = os.getenv('USE_BUILDBOT_VERSION2') is not None
-
 from twisted.application import service
 from buildbot.master import BuildMaster
 
 basedir = '.'
-if USE_BUILDBOT_VERSION2:
-    configfile = r'master_buildbot2.cfg'
-else:
-    configfile = r'master.cfg'
+configfile = r'master_buildbot2.cfg'
 rotateLength = 50000000
 maxRotatedFiles = 20
 umask = 0o022

Modified: trunk/Tools/CISupport/build-webkit-org/loadConfig.py (272680 => 272681)


--- trunk/Tools/CISupport/build-webkit-org/loadConfig.py	2021-02-10 21:04:13 UTC (rev 272680)
+++ trunk/Tools/CISupport/build-webkit-org/loadConfig.py	2021-02-10 21:06:30 UTC (rev 272681)
@@ -21,12 +21,8 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 import os
-USE_BUILDBOT_VERSION2 = os.getenv('USE_BUILDBOT_VERSION2') is not None
 
-if USE_BUILDBOT_VERSION2:
-    from buildbot.worker import Worker
-else:
-    from buildbot.buildslave import BuildSlave
+from buildbot.worker import Worker
 from buildbot.scheduler import AnyBranchScheduler, Triggerable, Nightly
 from buildbot.schedulers.forcesched import FixedParameter, ForceScheduler, StringParameter, BooleanParameter
 from buildbot.schedulers.filter import ChangeFilter
@@ -62,10 +58,7 @@
         os.environ['RESULTS_SERVER_API_KEY'] = results_server_api_key
 
     config = json.load(open('config.json'))
-    if USE_BUILDBOT_VERSION2:
-        c['workers'] = [Worker(worker['name'], passwords.get(worker['name'], 'password'), max_builds=1) for worker in config['workers']]
-    else:
-        c['slaves'] = [BuildSlave(worker['name'], passwords.get(worker['name'], 'password'), max_builds=1) for worker in config['workers']]
+    c['workers'] = [Worker(worker['name'], passwords.get(worker['name'], 'password'), max_builds=1) for worker in config['workers']]
 
     c['schedulers'] = []
     for scheduler in config['schedulers']:
@@ -79,23 +72,7 @@
     builderNames = [str(builder['name']) for builder in config['builders']]
     reason = StringParameter(name='reason', default='', size=40)
     properties = [BooleanParameter(name='is_clean', label='Force Clean build')]
-    if USE_BUILDBOT_VERSION2:
-        forceScheduler = ForceScheduler(name='force', builderNames=builderNames, reason=reason, properties=properties)
-    else:
-        forceScheduler = ForceScheduler(
-            name='force',
-            builderNames=builderNames,
-            reason=reason,
-
-            # Validate SVN revision: number or empty string
-            revision=StringParameter(name="revision", default="", regex=re.compile(r'^(\d*)$')),
-
-            # Disable default enabled input fields: branch, repository, project, additional properties
-            branch=FixedParameter(name="branch"),
-            repository=FixedParameter(name="repository"),
-            project=FixedParameter(name="project"),
-            properties=properties
-        )
+    forceScheduler = ForceScheduler(name='force', builderNames=builderNames, reason=reason, properties=properties)
     c['schedulers'].append(forceScheduler)
 
     c['builders'] = []
@@ -109,8 +86,6 @@
                     raise Exception('Builder {} is for platform {} but has worker {} for platform {}!'.format(builder['name'], builder['platform'], worker['name'], worker['platform']))
                 break
 
-        if not USE_BUILDBOT_VERSION2:
-            builder['slavenames'] = builder.pop('workernames')
         platform = builder['platform']
 
         factoryName = builder.pop('factory')
@@ -129,10 +104,7 @@
         if not buildbot_identifiers_re.match(builder_name):
             raise Exception('Builder name "{}" is not a valid buildbot identifier.'.format(builder_name))
         for step in builder["factory"].steps:
-            if USE_BUILDBOT_VERSION2:
-                step_name = step.buildStep().name
-            else:
-                step_name = step[0].name
+            step_name = step.buildStep().name
             if len(step_name) > STEP_NAME_LENGTH_LIMIT:
                 raise Exception('step name "{}" is longer than maximum allowed by Buildbot ({} characters).'.format(step_name, STEP_NAME_LENGTH_LIMIT))
             if not buildbot_identifiers_re.match(step_name):
@@ -158,10 +130,7 @@
         if (category in ('AppleMac', 'AppleWin', 'iOS')) and factoryName != 'BuildFactory':
             builder['nextBuild'] = pickLatestBuild
 
-        if USE_BUILDBOT_VERSION2:
-            builder['tags'] = getTagsForBuilder(builder)
-        else:
-            builder['category'] = category
+        builder['tags'] = getTagsForBuilder(builder)
         c['builders'].append(builder)
 
 

Modified: trunk/Tools/CISupport/build-webkit-org/loadConfig_unittest.py (272680 => 272681)


--- trunk/Tools/CISupport/build-webkit-org/loadConfig_unittest.py	2021-02-10 21:04:13 UTC (rev 272680)
+++ trunk/Tools/CISupport/build-webkit-org/loadConfig_unittest.py	2021-02-10 21:06:30 UTC (rev 272681)
@@ -27,9 +27,7 @@
 import os
 import unittest
 
-USE_BUILDBOT_VERSION2 = os.getenv('USE_BUILDBOT_VERSION2') is not None
-if USE_BUILDBOT_VERSION2:
-    import loadConfig
+import loadConfig
 
 class ConfigDotJSONTest(unittest.TestCase):
     def get_config(self):

Deleted: trunk/Tools/CISupport/build-webkit-org/master.cfg (272680 => 272681)


--- trunk/Tools/CISupport/build-webkit-org/master.cfg	2021-02-10 21:04:13 UTC (rev 272680)
+++ trunk/Tools/CISupport/build-webkit-org/master.cfg	2021-02-10 21:06:30 UTC (rev 272681)
@@ -1,48 +0,0 @@
-# -*- python -*-
-# ex: set syntax=python:
-
-from buildbot.changes.pb import PBChangeSource
-from buildbot.status import html
-from buildbot.status.web.authz import Authz
-
-from committer_auth import CommitterAuth
-from loadConfig import *
-
-
-is_test_mode_enabled = os.getenv('BUILDBOT_TESTING') is not None
-
-c = BuildmasterConfig = {}
-
-c['change_source'] = PBChangeSource(port=16000)
-
-# permissions for WebStatus
-authz = Authz(
-    auth=CommitterAuth('auth.json'),
-    forceBuild='auth',
-    forceAllBuilds='auth',
-    pingBuilder=True,
-    gracefulShutdown=False,
-    stopBuild='auth',
-    stopAllBuilds='auth',
-    cancelPendingBuild='auth',
-    stopChange=True,
-    cleanShutdown=False)
-
-c['status'] = []
-c['status'].append(html.WebStatus(http_port=8710,
-                                  revlink="https://trac.webkit.org/changeset/%s", 
-                                  changecommentlink=(r"(https://bugs\.webkit\.org/show_bug\.cgi\?id=|webkit\.org/b/)(\d+)", r"https://bugs.webkit.org/show_bug.cgi?id=\2"),
-                                  authz=authz))
-
-c['slavePortnum'] = 17000
-c['projectName'] = "WebKit"
-c['projectURL'] = "https://webkit.org"
-c['buildbotURL'] = "https://build.webkit.org/"
-
-c['buildHorizon'] = 1000
-c['logHorizon'] = 500
-c['eventHorizon'] = 200
-c['buildCacheSize'] = 60
-
-
-loadBuilderConfig(c, is_test_mode_enabled=is_test_mode_enabled)

Modified: trunk/Tools/CISupport/build-webkit-org/steps.py (272680 => 272681)


--- trunk/Tools/CISupport/build-webkit-org/steps.py	2021-02-10 21:04:13 UTC (rev 272680)
+++ trunk/Tools/CISupport/build-webkit-org/steps.py	2021-02-10 21:06:30 UTC (rev 272681)
@@ -20,8 +20,10 @@
 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-from buildbot.process import buildstep, factory, properties
+from buildbot.process import buildstep, factory, logobserver, properties
+from buildbot.process.results import Results
 from buildbot.steps import master, shell, transfer, trigger
+from buildbot.steps.source.svn import SVN
 from buildbot.status.builder import SUCCESS, FAILURE, WARNINGS, SKIPPED, EXCEPTION
 
 from twisted.internet import defer
@@ -39,18 +41,8 @@
 RESULTS_SERVER_API_KEY = 'RESULTS_SERVER_API_KEY'
 S3URL = 'https://s3-us-west-2.amazonaws.com/'
 S3_RESULTS_URL = '{}build.webkit.org-results/'.format(S3URL)
-USE_BUILDBOT_VERSION2 = os.getenv('USE_BUILDBOT_VERSION2') is not None
 WithProperties = properties.WithProperties
-if USE_BUILDBOT_VERSION2:
-    Interpolate = properties.Interpolate
-    from buildbot.process import logobserver
-    from buildbot.process.results import Results
-    from buildbot.steps.source.svn import SVN
-else:
-    import cStringIO
-    from buildbot.steps.source import SVN
-    logobserver = lambda: None
-    logobserver.LineConsumerLogObserver = type('LineConsumerLogObserver', (object,), {})
+Interpolate = properties.Interpolate
 
 
 class ParseByLineLogObserver(logobserver.LineConsumerLogObserver):
@@ -92,17 +84,6 @@
 
         return SUCCESS
 
-    def getText(self, cmd, results):
-        # FIXME: delete this method after switching to Buildbot v2
-        return self.getText2(cmd, results)
-
-    def getText2(self, cmd, results):
-        # FIXME: delete this method after switching to Buildbot v2
-        if results != SUCCESS and self.failedTestCount:
-            return [self.failedTestsFormatString % (self.failedTestCount, self.failedTestPluralSuffix)]
-
-        return [self.name]
-
     def getResultSummary(self):
         status = self.name
 
@@ -131,8 +112,6 @@
         self.buildOnly = buildOnly
         self.additionalArguments = additionalArguments
         self.device_model = device_model
-        if not USE_BUILDBOT_VERSION2:
-            self.addFactoryArguments(platform=platform, configuration=configuration, architecture=architecture, buildOnly=buildOnly, additionalArguments=additionalArguments, device_model=device_model)
 
     def start(self):
         self.setProperty("platform", self.platform)
@@ -151,13 +130,8 @@
 
 class CheckOutSource(SVN, object):
     def __init__(self, **kwargs):
-        if USE_BUILDBOT_VERSION2:
-            kwargs['repourl'] = 'https://svn.webkit.org/repository/webkit/trunk'
-            kwargs['mode'] = 'incremental'
-        else:
-            kwargs['baseURL'] = "https://svn.webkit.org/repository/webkit/"
-            kwargs['defaultBranch'] = "trunk"
-            kwargs['mode'] = 'update'
+        kwargs['repourl'] = 'https://svn.webkit.org/repository/webkit/trunk'
+        kwargs['mode'] = 'incremental'
         super(CheckOutSource, self).__init__(**kwargs)
 
 
@@ -274,9 +248,8 @@
         architecture = self.getProperty('architecture')
         additionalArguments = self.getProperty('additionalArguments')
 
-        if USE_BUILDBOT_VERSION2:
-            self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
-            self.addLogObserver('stdio', self.log_observer)
+        self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
+        self.addLogObserver('stdio', self.log_observer)
 
         if additionalArguments:
             self.setCommand(self.command + additionalArguments)
@@ -309,26 +282,7 @@
             log = yield self.addLog(logName)
         log.addStdout(message)
 
-    def createSummary(self, log):
-        # FIXME: delete this method after switching to Buildbot v2
-        if USE_BUILDBOT_VERSION2:
-            return
-        platform = self.getProperty('platform')
-        if platform.startswith('mac'):
-            warnings = []
-            errors = []
-            sio = cStringIO.StringIO(log.getText())
-            for line in sio.readlines():
-                if "arning:" in line:
-                    warnings.append(line)
-                if "rror:" in line:
-                    errors.append(line)
-            if warnings:
-                self.addCompleteLog('warnings', "".join(warnings))
-            if errors:
-                self.addCompleteLog('errors', "".join(errors))
 
-
 class CompileLLINTCLoop(CompileWebKit):
     command = ["perl", "./Tools/Scripts/build-jsc", "--cloop", WithProperties("--%(configuration)s")]
 
@@ -392,10 +346,7 @@
     haltOnFailure = True
 
     def __init__(self, **kwargs):
-        if USE_BUILDBOT_VERSION2:
-            kwargs['workersrc'] = self.workersrc
-        else:
-            kwargs['slavesrc'] = self.workersrc
+        kwargs['workersrc'] = self.workersrc
         kwargs['masterdest'] = self.masterdest
         kwargs['mode'] = 0o644
         kwargs['blocksize'] = 1024 * 256
@@ -419,15 +370,12 @@
 
     def start(self):
         if 'apple' in self.getProperty('buildername').lower():
-            if USE_BUILDBOT_VERSION2:
-                self.workerEnvironment['HTTPS_PROXY'] = APPLE_WEBKIT_AWS_PROXY  # curl env var to use a proxy
-            else:
-                self.slaveEnvironment['HTTPS_PROXY'] = APPLE_WEBKIT_AWS_PROXY  # curl env var to use a proxy
+            self.workerEnvironment['HTTPS_PROXY'] = APPLE_WEBKIT_AWS_PROXY  # curl env var to use a proxy
         return shell.ShellCommand.start(self)
 
     def evaluateCommand(self, cmd):
         rc = shell.ShellCommand.evaluateCommand(self, cmd)
-        if rc == FAILURE and USE_BUILDBOT_VERSION2:
+        if rc == FAILURE:
             self.build.addStepsAfterCurrentStep([DownloadBuiltProductFromMaster()])
         return rc
 
@@ -480,10 +428,7 @@
         TestWithFailureCount.__init__(self, *args, **kwargs)
 
     def start(self):
-        if USE_BUILDBOT_VERSION2:
-            self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
-        else:
-            self.slaveEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
         platform = self.getProperty('platform')
         architecture = self.getProperty("architecture")
         # Currently run-_javascript_core-test doesn't support run _javascript_ core test binaries list below remotely
@@ -528,10 +473,9 @@
     test_summary_re = re.compile(r'^\! NEW FAIL')
 
     def start(self):
-        if USE_BUILDBOT_VERSION2:
-            self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
-            self.addLogObserver('stdio', self.log_observer)
-            self.failedTestCount = 0
+        self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
+        self.addLogObserver('stdio', self.log_observer)
+        self.failedTestCount = 0
         appendCustomBuildFlags(self, self.getProperty('platform'), self.getProperty('fullPlatform'))
         return shell.Test.start(self)
 
@@ -541,16 +485,9 @@
             self.failedTestCount += 1
 
     def countFailures(self, cmd):
-        if USE_BUILDBOT_VERSION2:
-            return self.failedTestCount
+        return self.failedTestCount
 
-        logText = cmd.logs['stdio'].getText()
-        matches = re.findall(r'^\! NEW FAIL', logText, flags=re.MULTILINE)
-        if matches:
-            return len(matches)
-        return 0
 
-
 class RunWebKitTests(shell.Test):
     name = "layout-test"
     description = ["layout-tests running"]
@@ -585,14 +522,11 @@
         shell.Test.__init__(self, *args, **kwargs)
 
     def start(self):
-        if USE_BUILDBOT_VERSION2:
-            self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
-            self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
-            self.addLogObserver('stdio', self.log_observer)
-            self.incorrectLayoutLines = []
-            self.testFailures = {}
-        else:
-            self.slaveEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
+        self.addLogObserver('stdio', self.log_observer)
+        self.incorrectLayoutLines = []
+        self.testFailures = {}
 
         platform = self.getProperty('platform')
         appendCustomTestingFlags(self, platform, self.getProperty('device_model'))
@@ -614,29 +548,6 @@
             return match_object.group('message')
         return line
 
-    def _parseRunWebKitTestsOutput(self, logText):
-        # FIXME: delete this method after switching to Buildbot v2
-        incorrectLayoutLines = []
-        testFailures = {}
-
-        for line in logText.splitlines():
-            if line.find('Exiting early') >= 0 or line.find('leaks found') >= 0:
-                incorrectLayoutLines.append(self._strip_python_logging_prefix(line))
-                continue
-            for name, _expression_ in self.expressions:
-                match = _expression_.search(line)
-
-                if match:
-                    testFailures[name] = testFailures.get(name, 0) + int(match.group(1))
-                    break
-
-                # FIXME: Parse file names and put them in results
-
-        for name in testFailures:
-            incorrectLayoutLines.append(str(testFailures[name]) + ' ' + name)
-
-        self.incorrectLayoutLines = incorrectLayoutLines
-
     def parseOutputLine(self, line):
         if r'Exiting early' in line or r'leaks found' in line:
             self.incorrectLayoutLines.append(self._strip_python_logging_prefix(line))
@@ -651,18 +562,8 @@
         for name, result in self.testFailures.items():
             self.incorrectLayoutLines.append(str(result) + ' ' + name)
 
-    def commandComplete(self, cmd):
-        # FIXME: delete this method after switching to Buildbot v2
-        shell.Test.commandComplete(self, cmd)
-
-        if not USE_BUILDBOT_VERSION2:
-            logText = cmd.logs['stdio'].getText()
-            self._parseRunWebKitTestsOutput(logText)
-
     def evaluateCommand(self, cmd):
-        if USE_BUILDBOT_VERSION2:
-            self.processTestFailures()
-
+        self.processTestFailures()
         result = SUCCESS
 
         if self.incorrectLayoutLines:
@@ -695,18 +596,7 @@
             return {'step': status}
         return super(RunWebKitTests, self).getResultSummary()
 
-    def getText(self, cmd, results):
-        # FIXME: delete this method after switching to Buildbot v2
-        return self.getText2(cmd, results)
 
-    def getText2(self, cmd, results):
-        # FIXME: delete this method after switching to Buildbot v2
-        if results != SUCCESS and self.incorrectLayoutLines:
-            return self.incorrectLayoutLines
-
-        return [self.name]
-
-
 class RunDashboardTests(RunWebKitTests):
     name = "dashboard-tests"
     description = ["dashboard-tests running"]
@@ -745,27 +635,16 @@
         TestWithFailureCount.__init__(self, *args, **kwargs)
 
     def start(self):
-        if USE_BUILDBOT_VERSION2:
-            self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
-            self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
-            self.addLogObserver('stdio', self.log_observer)
-            self.failedTestCount = 0
-        else:
-            self.slaveEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
+        self.addLogObserver('stdio', self.log_observer)
+        self.failedTestCount = 0
         appendCustomTestingFlags(self, self.getProperty('platform'), self.getProperty('device_model'))
         return shell.Test.start(self)
 
     def countFailures(self, cmd):
-        if USE_BUILDBOT_VERSION2:
-            return self.failedTestCount
+        return self.failedTestCount
 
-        log_text = cmd.logs['stdio'].getText()
-
-        match = re.search(r'Ran (?P<ran>\d+) tests of (?P<total>\d+) with (?P<passed>\d+) successful', log_text)
-        if not match:
-            return -1
-        return int(match.group('ran')) - int(match.group('passed'))
-
     def parseOutputLine(self, line):
         match = self.test_summary_re.match(line)
         if match:
@@ -776,10 +655,9 @@
     test_summary_re = re.compile(r'^FAILED \((?P<counts>[^)]+)\)')  # e.g.: FAILED (failures=2, errors=1)
 
     def start(self):
-        if USE_BUILDBOT_VERSION2:
-            self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
-            self.addLogObserver('stdio', self.log_observer)
-            self.failedTestCount = 0
+        self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
+        self.addLogObserver('stdio', self.log_observer)
+        self.failedTestCount = 0
         platform = self.getProperty('platform')
         # Python tests are flaky on the GTK builders, running them serially
         # helps and does not significantly prolong the cycle time.
@@ -797,20 +675,9 @@
             self.failedTestCount = sum(int(component.split('=')[1]) for component in match.group('counts').split(', '))
 
     def countFailures(self, cmd):
-        if USE_BUILDBOT_VERSION2:
-            return self.failedTestCount
+        return self.failedTestCount
 
-        logText = cmd.logs['stdio'].getText()
-        # We're looking for the line that looks like this: FAILED (failures=2, errors=1)
-        regex = re.compile(r'^FAILED \((?P<counts>[^)]+)\)')
-        for line in logText.splitlines():
-            match = regex.match(line)
-            if not match:
-                continue
-            return sum(int(component.split('=')[1]) for component in match.group('counts').split(', '))
-        return 0
 
-
 class RunWebKitPyTests(RunPythonTests):
     name = "webkitpy-test"
     description = ["python-tests running"]
@@ -832,10 +699,7 @@
         RunPythonTests.__init__(self, *args, **kwargs)
 
     def start(self):
-        if USE_BUILDBOT_VERSION2:
-            self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
-        else:
-            self.slaveEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
         return RunPythonTests.start(self)
 
 
@@ -862,10 +726,9 @@
     test_summary_re = re.compile(r'^Failed \d+/\d+ test programs\. (?P<count>\d+)/\d+ subtests failed\.')  # e.g.: Failed 2/19 test programs. 5/363 subtests failed.
 
     def start(self):
-        if USE_BUILDBOT_VERSION2:
-            self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
-            self.addLogObserver('stdio', self.log_observer)
-            self.failedTestCount = 0
+        self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
+        self.addLogObserver('stdio', self.log_observer)
+        self.failedTestCount = 0
         return shell.Test.start(self)
 
     def parseOutputLine(self, line):
@@ -874,20 +737,9 @@
             self.failedTestCount = int(match.group('count'))
 
     def countFailures(self, cmd):
-        if USE_BUILDBOT_VERSION2:
-            return self.failedTestCount
+        return self.failedTestCount
 
-        logText = cmd.logs['stdio'].getText()
-        # We're looking for the line that looks like this: Failed 2/19 test programs. 5/363 subtests failed.
-        regex = re.compile(r'^Failed \d+/\d+ test programs\. (?P<count>\d+)/\d+ subtests failed\.')
-        for line in logText.splitlines():
-            match = regex.match(line)
-            if not match:
-                continue
-            return int(match.group('count'))
-        return 0
 
-
 class RunLLINTCLoopTests(TestWithFailureCount):
     name = "webkit-jsc-cloop-test"
     description = ["cloop-tests running"]
@@ -914,13 +766,10 @@
         TestWithFailureCount.__init__(self, *args, **kwargs)
 
     def start(self):
-        if USE_BUILDBOT_VERSION2:
-            self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
-            self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
-            self.addLogObserver('stdio', self.log_observer)
-            self.failedTestCount = 0
-        else:
-            self.slaveEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
+        self.addLogObserver('stdio', self.log_observer)
+        self.failedTestCount = 0
         return shell.Test.start(self)
 
     def parseOutputLine(self, line):
@@ -929,20 +778,9 @@
             self.failedTestCount = int(match.group('count'))
 
     def countFailures(self, cmd):
-        if USE_BUILDBOT_VERSION2:
-            return self.failedTestCount
+        return self.failedTestCount
 
-        logText = cmd.logs['stdio'].getText()
-        # We're looking for the line that looks like this: 0 regressions found.
-        regex = re.compile(r'\s*(?P<count>\d+) regressions? found.')
-        for line in logText.splitlines():
-            match = regex.match(line)
-            if not match:
-                continue
-            return int(match.group('count'))
-        return 0
 
-
 class Run32bitJSCTests(TestWithFailureCount):
     name = "webkit-32bit-jsc-test"
     description = ["32bit-jsc-tests running"]
@@ -969,13 +807,10 @@
         TestWithFailureCount.__init__(self, *args, **kwargs)
 
     def start(self):
-        if USE_BUILDBOT_VERSION2:
-            self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
-            self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
-            self.addLogObserver('stdio', self.log_observer)
-            self.failedTestCount = 0
-        else:
-            self.slaveEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
+        self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
+        self.addLogObserver('stdio', self.log_observer)
+        self.failedTestCount = 0
         return shell.Test.start(self)
 
     def parseOutputLine(self, line):
@@ -984,20 +819,9 @@
             self.failedTestCount = int(match.group('count'))
 
     def countFailures(self, cmd):
-        if USE_BUILDBOT_VERSION2:
-            return self.failedTestCount
+        return self.failedTestCount
 
-        logText = cmd.logs['stdio'].getText()
-        # We're looking for the line that looks like this: 0 failures found.
-        regex = re.compile(r'\s*(?P<count>\d+) failures? found.')
-        for line in logText.splitlines():
-            match = regex.match(line)
-            if not match:
-                continue
-            return int(match.group('count'))
-        return 0
 
-
 class RunBindingsTests(shell.Test):
     name = "bindings-generation-tests"
     description = ["bindings-tests running"]
@@ -1243,10 +1067,7 @@
     masterdest = WithProperties("public_html/results/%(buildername)s/r%(got_revision)s (%(buildnumber)s).zip")
 
     def __init__(self, **kwargs):
-        if USE_BUILDBOT_VERSION2:
-            kwargs['workersrc'] = self.workersrc
-        else:
-            kwargs['slavesrc'] = self.workersrc
+        kwargs['workersrc'] = self.workersrc
         kwargs['masterdest'] = self.masterdest
         kwargs['mode'] = 0o644
         kwargs['blocksize'] = 1024 * 256
@@ -1261,18 +1082,15 @@
     minifiedArchive = WithProperties("archives/%(fullPlatform)s-%(architecture)s-%(configuration)s/minified-%(got_revision)s.zip")
     identifier = WithProperties("%(fullPlatform)s-%(architecture)s-%(configuration)s")
     revision = WithProperties("%(got_revision)s")
-    command = ["python", "../Shared/transfer-archive-to-s3", "--revision", revision, "--identifier", identifier, "--archive", archive]
+    command = ["python3", "../Shared/transfer-archive-to-s3", "--revision", revision, "--identifier", identifier, "--archive", archive]
     haltOnFailure = True
 
     def __init__(self, **kwargs):
         kwargs['command'] = self.command
-        if USE_BUILDBOT_VERSION2:
-            kwargs['logEnviron'] = False
+        kwargs['logEnviron'] = False
         master.MasterShellCommand.__init__(self, **kwargs)
 
     def start(self):
-        if USE_BUILDBOT_VERSION2:
-            self.command[0] = 'python3'
         return master.MasterShellCommand.start(self)
 
     def finished(self, result):
@@ -1285,34 +1103,20 @@
 class ExtractTestResults(master.MasterShellCommand):
     name = 'extract-test-results'
     descriptionDone = ['Extracted test results']
-    if USE_BUILDBOT_VERSION2:
-        renderables = ['resultDirectory', 'zipFile']
+    renderables = ['resultDirectory', 'zipFile']
 
     def __init__(self, **kwargs):
         kwargs['command'] = ""
-        if USE_BUILDBOT_VERSION2:
-            kwargs['logEnviron'] = False
-            self.zipFile = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:got_revision)s (%(prop:buildnumber)s).zip')
-            self.resultDirectory = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:got_revision)s (%(prop:buildnumber)s)')
-            kwargs['command'] = ['echo', 'Unzipping in background, it might take a while.']
+        kwargs['logEnviron'] = False
+        self.zipFile = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:got_revision)s (%(prop:buildnumber)s).zip')
+        self.resultDirectory = Interpolate('public_html/results/%(prop:buildername)s/r%(prop:got_revision)s (%(prop:buildnumber)s)')
+        kwargs['command'] = ['echo', 'Unzipping in background, it might take a while.']
         master.MasterShellCommand.__init__(self, **kwargs)
 
     def resultDirectoryURL(self):
-        if USE_BUILDBOT_VERSION2:
-            path = self.resultDirectory.replace('public_html/results/', '') + '/'
-            return '{}{}'.format(S3_RESULTS_URL, path)
-        else:
-            return self.build.getProperties().render(self.resultDirectory).replace('public_html/', '/') + '/'
+        path = self.resultDirectory.replace('public_html/results/', '') + '/'
+        return '{}{}'.format(S3_RESULTS_URL, path)
 
-    def start(self):
-        if not USE_BUILDBOT_VERSION2:
-            self.zipFile = WithProperties("public_html/results/%(buildername)s/r%(got_revision)s (%(buildnumber)s).zip")
-            self.resultDirectory = WithProperties("public_html/results/%(buildername)s/r%(got_revision)s (%(buildnumber)s)")
-            self.zipFile = self.build.getProperties().render(self.zipFile)
-            self.resultDirectory = self.build.getProperties().render(self.resultDirectory)
-            self.command = ['unzip', '-q', '-o', self.zipFile, '-d', self.resultDirectory]
-        return master.MasterShellCommand.start(self)
-
     def addCustomURLs(self):
         self.addURL("view layout test results", self.resultDirectoryURL() + "results.html")
         self.addURL("view dashboard test results", self.resultDirectoryURL() + "dashboard-layout-test-results/results.html")

Modified: trunk/Tools/CISupport/ews-build/steps.py (272680 => 272681)


--- trunk/Tools/CISupport/ews-build/steps.py	2021-02-10 21:04:13 UTC (rev 272680)
+++ trunk/Tools/CISupport/ews-build/steps.py	2021-02-10 21:06:30 UTC (rev 272681)
@@ -1205,7 +1205,6 @@
         super(RunBuildWebKitOrgUnitTests, self).__init__(workdir='build/Tools/CISupport', timeout=2 * 60, logEnviron=False, **kwargs)
 
     def start(self):
-        self.workerEnvironment['USE_BUILDBOT_VERSION2'] = 'True'
         return shell.ShellCommand.start(self)
 
     def getResultSummary(self):

Modified: trunk/Tools/CISupport/ews-build/steps_unittest.py (272680 => 272681)


--- trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-02-10 21:04:13 UTC (rev 272680)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-02-10 21:06:30 UTC (rev 272681)
@@ -738,7 +738,6 @@
                         timeout=120,
                         logEnviron=False,
                         command=['python3', 'runUnittests.py', 'build-webkit-org'],
-                        env={'USE_BUILDBOT_VERSION2': 'True'},
                         )
             + 0,
         )
@@ -752,7 +751,6 @@
                         timeout=120,
                         logEnviron=False,
                         command=['python3', 'runUnittests.py', 'build-webkit-org'],
-                        env={'USE_BUILDBOT_VERSION2': 'True'},
                         )
             + ExpectShell.log('stdio', stdout='Unhandled Error. Traceback (most recent call last): Keys in cmd missing from expectation: [logfiles.json]')
             + 2,

Modified: trunk/Tools/ChangeLog (272680 => 272681)


--- trunk/Tools/ChangeLog	2021-02-10 21:04:13 UTC (rev 272680)
+++ trunk/Tools/ChangeLog	2021-02-10 21:06:30 UTC (rev 272681)
@@ -1,3 +1,26 @@
+2021-02-10  Aakash Jain  <aakash_j...@apple.com>
+
+        [build.webkit.org] Remove code specific to old Buildbot
+        https://bugs.webkit.org/show_bug.cgi?id=221558
+
+        Reviewed by Jonathan Bedard.
+
+        * CISupport/build-webkit-org/buildbot.tac:
+        * CISupport/build-webkit-org/loadConfig.py:
+        * CISupport/build-webkit-org/loadConfig_unittest.py:
+        * CISupport/build-webkit-org/master.cfg: Removed.
+        * CISupport/build-webkit-org/steps.py:
+        (TestWithFailureCount.getText): Deleted.
+        (TestWithFailureCount.getText2): Deleted.
+        (CompileWebKit.createSummary): Deleted.
+        (RunWebKitTests._parseRunWebKitTestsOutput): Deleted.
+        (RunWebKitTests.commandComplete): Deleted.
+        (RunWebKitTests.getText): Deleted.
+        (RunWebKitTests.getText2): Deleted.
+        (ExtractTestResults.start): Deleted.
+        * CISupport/ews-build/steps.py:
+        * CISupport/ews-build/steps_unittest.py:
+
 2021-02-10  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Use HAVE(PEPPER_UI_CORE) instead of PLATFORM(WATCHOS) to guard code that uses PepperUICore
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to