Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: appengine/findit/waterfall/extractor.py

Issue 838003004: [Findit] Add three sub-pipelines to analyze build failure. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: . Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from waterfall import extractor_util 5 from waterfall import extractor_util
6 6
7 7
8 class Extractor(object): 8 class Extractor(object):
9 """An interface to extract failure signal from a failed step or test.""" 9 """An interface to extract failure signal from a failed step or test."""
10 10
11 def ExtractFiles(self, message_line, failure_signal): 11 def ExtractFiles(self, message_line, failure_signal):
12 """Extract files from given message line into ``failure_signal``.""" 12 """Extract files from given message line into ``failure_signal``."""
13 match = extractor_util.PYTHON_STACK_TRACE_PATTERN.match(message_line) 13 match = extractor_util.PYTHON_STACK_TRACE_PATTERN.match(message_line)
14 if match: 14 if match:
15 trace_line = match.groupdict() 15 trace_line = match.groupdict()
16 failure_signal.AddFile(trace_line['file'], trace_line['line']) 16 failure_signal.AddFile(
17 extractor_util.NormalizeFilePath(trace_line['file']),
18 trace_line['line'])
17 else: 19 else:
18 for match in extractor_util.FILE_PATH_LINE_PATTERN.finditer(message_line): 20 for match in extractor_util.FILE_PATH_LINE_PATTERN.finditer(message_line):
19 file_path, line_number = match.groups() 21 file_path, line_number = match.groups()
20 failure_signal.AddFile(extractor_util.NormalizeFilePath(file_path), 22 failure_signal.AddFile(extractor_util.NormalizeFilePath(file_path),
21 line_number) 23 line_number)
22 24
23 25
24 # pylint disable=W0613, R0201 26 # pylint disable=W0613, R0201
25 def Extract(self, failure_log, test_name, step_name, bot_name, master_name): 27 def Extract(self, failure_log, test_name, step_name, bot_name, master_name):
26 """Analyze ``failure_log``, extract and return a FailureSignal.""" 28 """Analyze ``failure_log``, extract and return a FailureSignal."""
27 raise NotImplementedError() 29 raise NotImplementedError()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698