⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 269786 in webkit


Ignore:
Timestamp:
Nov 13, 2020, 10:22:32 AM (6 years ago)
Author:
aakash_jain@apple.com
Message:

[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.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/CISupport/build-webkit-org/steps.py

    r269781 r269786  
    4545    Interpolate = properties.Interpolate
    4646    from buildbot.process import logobserver
     47    from buildbot.process.results import Results
    4748    from buildbot.steps.source.svn import SVN
    4849else:
     
    9293
    9394    def getText(self, cmd, results):
     95        # FIXME: delete this method after switching to Buildbot v2
    9496        return self.getText2(cmd, results)
    9597
    9698    def getText2(self, cmd, results):
     99        # FIXME: delete this method after switching to Buildbot v2
    97100        if results != SUCCESS and self.failedTestCount:
    98101            return [self.failedTestsFormatString % (self.failedTestCount, self.failedTestPluralSuffix)]
    99102
    100103        return [self.name]
     104
     105    def getResultSummary(self):
     106        status = self.name
     107
     108        if self.results != SUCCESS:
     109            if self.failedTestCount:
     110                status = self.failedTestsFormatString % (self.failedTestCount, self.failedTestPluralSuffix)
     111            else:
     112                status += ' ({})'.format(Results[self.results])
     113
     114        return {'step': status}
    101115
    102116
     
    618632
    619633        if self.results != SUCCESS and self.incorrectLayoutLines:
    620             status = u' '.join(self.incorrectLayoutLines)
    621             return {u'step': status}
     634            status = ' '.join(self.incorrectLayoutLines)
     635            return {'step': status}
    622636        return super(RunWebKitTests, self).getResultSummary()
    623637
     
    665679    ]
    666680    failedTestsFormatString = "%d api test%s failed or timed out"
     681    test_summary_re = re.compile(r'Ran (?P<ran>\d+) tests of (?P<total>\d+) with (?P<passed>\d+) successful')
    667682
    668683    def __init__(self, *args, **kwargs):
     
    673688        if USE_BUILDBOT_VERSION2:
    674689            self.workerEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
     690            self.log_observer = ParseByLineLogObserver(self.parseOutputLine)
     691            self.addLogObserver('stdio', self.log_observer)
     692            self.failedTestCount = 0
    675693        else:
    676694            self.slaveEnvironment[RESULTS_SERVER_API_KEY] = os.getenv(RESULTS_SERVER_API_KEY)
     
    679697
    680698    def countFailures(self, cmd):
     699        if USE_BUILDBOT_VERSION2:
     700            return self.failedTestCount
     701
    681702        log_text = cmd.logs['stdio'].getText()
    682703
     
    685706            return -1
    686707        return int(match.group('ran')) - int(match.group('passed'))
     708
     709    def parseOutputLine(self, line):
     710        match = self.test_summary_re.match(line)
     711        if match:
     712            self.failedTestCount = int(match.group('ran')) - int(match.group('passed'))
    687713
    688714
  • trunk/Tools/ChangeLog

    r269785 r269786  
     12020-11-13  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [build.webkit.org] Update RunAPITests step for new buildbot
     4        https://bugs.webkit.org/show_bug.cgi?id=218907
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * CISupport/build-webkit-org/steps.py:
     9        (TestWithFailureCount.getText): Added FIXME to remove this method after switching to buildbot v2.
     10        (TestWithFailureCount.getText2): Added FIXME to remove this method after switching to buildbot v2.
     11        (TestWithFailureCount.getResultSummary): Method to generate custom step summary.
     12        (RunWebKitTests.getResultSummary): Removed unnecessary u'', python3 defaults to unicode anyways.
     13        (RunAPITests):
     14        (RunAPITests.start): Use ParseByLineLogObserver.
     15        (RunAPITests.countFailures):
     16        (RunAPITests.parseOutputLine): Method to process each line.
     17
    1182020-11-12  Darin Adler  <darin@apple.com>
    219
Note: See TracChangeset for help on using the changeset viewer.