Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[build.webkit.org] Update RunAPITests step for new buildbot
https://bugs.webkit.org/show_bug.cgi?id=218907

Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/steps.py:
(TestWithFailureCount.getText): Added FIXME to remove this method after switching to buildbot v2.
(TestWithFailureCount.getText2): Added FIXME to remove this method after switching to buildbot v2.
(TestWithFailureCount.getResultSummary): Method to generate custom step summary.
(RunWebKitTests.getResultSummary): Removed unnecessary u'', python3 defaults to unicode anyways.
(RunAPITests):
(RunAPITests.start): Use ParseByLineLogObserver.
(RunAPITests.countFailures):
(RunAPITests.parseOutputLine): Method to process each line.


Canonical link: https://commits.webkit.org/231559@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aj062 committed Nov 13, 2020
1 parent 40615e5 commit 1d9315c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
30 changes: 28 additions & 2 deletions Tools/CISupport/build-webkit-org/steps.py
Expand Up @@ -44,6 +44,7 @@
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:
from buildbot.steps.source import SVN
Expand Down Expand Up @@ -91,14 +92,27 @@ def evaluateCommand(self, cmd):
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

if self.results != SUCCESS:
if self.failedTestCount:
status = self.failedTestsFormatString % (self.failedTestCount, self.failedTestPluralSuffix)
else:
status += ' ({})'.format(Results[self.results])

return {'step': status}


class ConfigureBuild(buildstep.BuildStep):
name = "configure-build"
Expand Down Expand Up @@ -617,8 +631,8 @@ def getResultSummary(self):
status = self.name

if self.results != SUCCESS and self.incorrectLayoutLines:
status = u' '.join(self.incorrectLayoutLines)
return {u'step': status}
status = ' '.join(self.incorrectLayoutLines)
return {'step': status}
return super(RunWebKitTests, self).getResultSummary()

def getText(self, cmd, results):
Expand Down Expand Up @@ -664,6 +678,7 @@ class RunAPITests(TestWithFailureCount):
"--report", RESULTS_WEBKIT_URL,
]
failedTestsFormatString = "%d api test%s failed or timed out"
test_summary_re = re.compile(r'Ran (?P<ran>\d+) tests of (?P<total>\d+) with (?P<passed>\d+) successful')

def __init__(self, *args, **kwargs):
kwargs['logEnviron'] = False
Expand All @@ -672,19 +687,30 @@ def __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)
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

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:
self.failedTestCount = int(match.group('ran')) - int(match.group('passed'))


class RunPythonTests(TestWithFailureCount):

Expand Down
17 changes: 17 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,20 @@
2020-11-13 Aakash Jain <aakash_jain@apple.com>

[build.webkit.org] Update RunAPITests step for new buildbot
https://bugs.webkit.org/show_bug.cgi?id=218907

Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/steps.py:
(TestWithFailureCount.getText): Added FIXME to remove this method after switching to buildbot v2.
(TestWithFailureCount.getText2): Added FIXME to remove this method after switching to buildbot v2.
(TestWithFailureCount.getResultSummary): Method to generate custom step summary.
(RunWebKitTests.getResultSummary): Removed unnecessary u'', python3 defaults to unicode anyways.
(RunAPITests):
(RunAPITests.start): Use ParseByLineLogObserver.
(RunAPITests.countFailures):
(RunAPITests.parseOutputLine): Method to process each line.

2020-11-12 Darin Adler <darin@apple.com>

Remove unused advanced plug-in features: snapshotting and plug-in load policy
Expand Down

0 comments on commit 1d9315c

Please sign in to comment.