Changeset 265391 in webkit


Ignore:
Timestamp:
Aug 7, 2020, 2:38:00 PM (4 years ago)
Author:
aakash_jain@apple.com
Message:

Windows EWS should filter build logs to show errors
https://bugs.webkit.org/show_bug.cgi?id=211344

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/steps.py:

(BuildLogLineObserver.init): Added searchString and includeRelatedLines arguments.
(BuildLogLineObserver.outLineReceived): Added support for generic searchString and enabling/disabling inclusion of related lines.
(CompileWebKit.start): Enabled log filtering for windows and wincairo.
(AnalyzeCompileWebKitResults.filter_logs_containing_error): Made it accept any generic searchString.
(AnalyzeCompileWebKitResults.send_email_for_new_build_failure): Pass different searchString for windows and wincairo.
(AnalyzeCompileWebKitResults.send_email_for_preexisting_build_failure): Ditto.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/ews-build/steps.py

    r265380 r265391  
    12521252
    12531253class BuildLogLineObserver(logobserver.LogLineObserver, object):
    1254     def __init__(self, errorReceived=None):
     1254    def __init__(self, errorReceived, searchString='rror:', includeRelatedLines=True):
    12551255        self.errorReceived = errorReceived
     1256        self.searchString = searchString
     1257        self.includeRelatedLines = includeRelatedLines
    12561258        self.error_context_buffer = []
    12571259        self.whitespace_re = re.compile('^[\s]*$')
     
    12591261
    12601262    def outLineReceived(self, line):
     1263        if not self.errorReceived:
     1264            return
     1265
     1266        if not self.includeRelatedLines:
     1267            if self.searchString in line:
     1268                self.errorReceived(line)
     1269            return
     1270
    12611271        is_whitespace = self.whitespace_re.search(line) is not None
    12621272        if is_whitespace:
     
    12651275            self.error_context_buffer.append(line)
    12661276
    1267         if 'rror:' in line and self.errorReceived:
     1277        if self.searchString in line:
    12681278            map(self.errorReceived, self.error_context_buffer)
    12691279            self.error_context_buffer = []
     
    12921302        additionalArguments = self.getProperty('additionalArguments')
    12931303
    1294         if platform != 'windows':
     1304        if platform in ['win', 'wincairo']:
     1305            self.addLogObserver('stdio', BuildLogLineObserver(self.errorReceived, searchString='error ', includeRelatedLines=False))
     1306        else:
    12951307            self.addLogObserver('stdio', BuildLogLineObserver(self.errorReceived))
    12961308
     
    14351447        return None
    14361448
    1437     def filter_logs_containing_error(self, logs, max_num_lines=10):
     1449    def filter_logs_containing_error(self, logs, searchString='rror:', max_num_lines=10):
    14381450        if not logs:
    14391451            return None
    14401452        filtered_logs = []
    14411453        for line in logs.splitlines():
    1442             if 'rror:' in line:
     1454            if searchString in line:
    14431455                filtered_logs.append(line)
    14441456        return '\n'.join(filtered_logs[-max_num_lines:])
     
    14511463            patch_id = self.getProperty('patch_id', '')
    14521464            patch_author = self.getProperty('patch_author', '')
     1465            platform = self.getProperty('platform', '')
    14531466            build_url = '{}#/builders/{}/builds/{}'.format(self.master.config.buildbotURL, self.build._builderid, self.build.number)
    1454             logs = self.filter_logs_containing_error(self.error_logs.get(self.compile_webkit_step))
     1467            logs = self.error_logs.get(self.compile_webkit_step)
     1468            if platform in ['win', 'wincairo']:
     1469                logs = self.filter_logs_containing_error(logs, searchString='error ')
     1470            else:
     1471                logs = self.filter_logs_containing_error(logs)
    14551472
    14561473            email_subject = 'Build failure for Patch {}: {}'.format(patch_id, bug_title)
     
    14681485            builder_name = self.getProperty('buildername', '')
    14691486            worker_name = self.getProperty('workername', '')
     1487            platform = self.getProperty('platform', '')
    14701488            build_url = '{}#/builders/{}/builds/{}'.format(self.master.config.buildbotURL, self.build._builderid, self.build.number)
    1471             logs = self.filter_logs_containing_error(self.error_logs.get(self.compile_webkit_step))
     1489            logs = self.error_logs.get(self.compile_webkit_step)
     1490            if platform in ['win', 'wincairo']:
     1491                logs = self.filter_logs_containing_error(logs, searchString='error ')
     1492            else:
     1493                logs = self.filter_logs_containing_error(logs)
    14721494
    14731495            email_subject = 'Build failure on trunk on {}'.format(builder_name)
  • trunk/Tools/ChangeLog

    r265389 r265391  
     12020-08-07  Aakash Jain  <aakash_jain@apple.com>
     2
     3        Windows EWS should filter build logs to show errors
     4        https://bugs.webkit.org/show_bug.cgi?id=211344
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * BuildSlaveSupport/ews-build/steps.py:
     9        (BuildLogLineObserver.__init__): Added searchString and includeRelatedLines arguments.
     10        (BuildLogLineObserver.outLineReceived): Added support for generic searchString and enabling/disabling inclusion of related lines.
     11        (CompileWebKit.start): Enabled log filtering for windows and wincairo.
     12        (AnalyzeCompileWebKitResults.filter_logs_containing_error): Made it accept any generic searchString.
     13        (AnalyzeCompileWebKitResults.send_email_for_new_build_failure):  Pass different searchString for windows and wincairo.
     14        (AnalyzeCompileWebKitResults.send_email_for_preexisting_build_failure): Ditto.
     15
    1162020-08-07  John Wilander  <wilander@apple.com>
    217
Note: See TracChangeset for help on using the changeset viewer.