Changeset 265391 in webkit
- Timestamp:
- Aug 7, 2020, 2:38:00 PM (4 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/ews-build/steps.py
r265380 r265391 1252 1252 1253 1253 class BuildLogLineObserver(logobserver.LogLineObserver, object): 1254 def __init__(self, errorReceived =None):1254 def __init__(self, errorReceived, searchString='rror:', includeRelatedLines=True): 1255 1255 self.errorReceived = errorReceived 1256 self.searchString = searchString 1257 self.includeRelatedLines = includeRelatedLines 1256 1258 self.error_context_buffer = [] 1257 1259 self.whitespace_re = re.compile('^[\s]*$') … … 1259 1261 1260 1262 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 1261 1271 is_whitespace = self.whitespace_re.search(line) is not None 1262 1272 if is_whitespace: … … 1265 1275 self.error_context_buffer.append(line) 1266 1276 1267 if 'rror:' in line and self.errorReceived:1277 if self.searchString in line: 1268 1278 map(self.errorReceived, self.error_context_buffer) 1269 1279 self.error_context_buffer = [] … … 1292 1302 additionalArguments = self.getProperty('additionalArguments') 1293 1303 1294 if platform != 'windows': 1304 if platform in ['win', 'wincairo']: 1305 self.addLogObserver('stdio', BuildLogLineObserver(self.errorReceived, searchString='error ', includeRelatedLines=False)) 1306 else: 1295 1307 self.addLogObserver('stdio', BuildLogLineObserver(self.errorReceived)) 1296 1308 … … 1435 1447 return None 1436 1448 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): 1438 1450 if not logs: 1439 1451 return None 1440 1452 filtered_logs = [] 1441 1453 for line in logs.splitlines(): 1442 if 'rror:'in line:1454 if searchString in line: 1443 1455 filtered_logs.append(line) 1444 1456 return '\n'.join(filtered_logs[-max_num_lines:]) … … 1451 1463 patch_id = self.getProperty('patch_id', '') 1452 1464 patch_author = self.getProperty('patch_author', '') 1465 platform = self.getProperty('platform', '') 1453 1466 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) 1455 1472 1456 1473 email_subject = 'Build failure for Patch {}: {}'.format(patch_id, bug_title) … … 1468 1485 builder_name = self.getProperty('buildername', '') 1469 1486 worker_name = self.getProperty('workername', '') 1487 platform = self.getProperty('platform', '') 1470 1488 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) 1472 1494 1473 1495 email_subject = 'Build failure on trunk on {}'.format(builder_name) -
trunk/Tools/ChangeLog
r265389 r265391 1 2020-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 1 16 2020-08-07 John Wilander <wilander@apple.com> 2 17
Note:
See TracChangeset
for help on using the changeset viewer.