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

Side by Side Diff: scripts/master/chromium_step.py

Issue 1812163002: Add log and link aliasing to BuildBot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Unused variable. Created 4 years, 9 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Subclasses of various slave command classes.""" 5 """Subclasses of various slave command classes."""
6 6
7 from datetime import datetime 7 from datetime import datetime
8 import copy 8 import copy
9 import errno 9 import errno
10 import json 10 import json
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 Add a new step <stepname> after the last step. Do not end the step at the 498 Add a new step <stepname> after the last step. Do not end the step at the
499 cursor, don't advance the cursor to the seeded step. 499 cursor, don't advance the cursor to the seeded step.
500 500
501 @@@STEP_CURSOR <stepname>@@@ 501 @@@STEP_CURSOR <stepname>@@@
502 Set the cursor to the named step. All further commands apply to the current 502 Set the cursor to the named step. All further commands apply to the current
503 cursor. 503 cursor.
504 504
505 @@@STEP_LINK@<label>@<url>@@@ 505 @@@STEP_LINK@<label>@<url>@@@
506 Add a link with label <label> linking to <url> to the current stage. 506 Add a link with label <label> linking to <url> to the current stage.
507 507
508 If the label value is of the form "text-->base", this is considered an alias
509 link, and will add an alias named "text" with the value "url" to the log or
510 link named "base".
511
508 @@@STEP_STARTED@@@ 512 @@@STEP_STARTED@@@
509 Start the step at the cursor location. 513 Start the step at the cursor location.
510 514
511 @@@STEP_WARNINGS@@@ 515 @@@STEP_WARNINGS@@@
512 Mark the current step as having warnings (orange). 516 Mark the current step as having warnings (orange).
513 517
514 @@@STEP_FAILURE@@@ 518 @@@STEP_FAILURE@@@
515 Mark the current step as having failed (red). 519 Mark the current step as having failed (red).
516 520
517 @@@STEP_EXCEPTION@@@ 521 @@@STEP_EXCEPTION@@@
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 # then add the new graph list to the main graph list. 1021 # then add the new graph list to the main graph list.
1018 graph_list.extend(new_graph_list) 1022 graph_list.extend(new_graph_list)
1019 1023
1020 # Write the resulting graph list. 1024 # Write the resulting graph list.
1021 graph_file = open(graph_filename, 'w') 1025 graph_file = open(graph_filename, 'w')
1022 json.dump(graph_list, graph_file) 1026 json.dump(graph_list, graph_file)
1023 graph_file.close() 1027 graph_file.close()
1024 os.chmod(graph_filename, EXECUTABLE_FILE_PERMISSIONS) 1028 os.chmod(graph_filename, EXECUTABLE_FILE_PERMISSIONS)
1025 1029
1026 def addLinkToCursor(self, link_label, link_url): 1030 def addLinkToCursor(self, link_label, link_url):
1027 self.cursor['links'].append((link_label, link_url)) 1031 parts = link_label.split('-->', 1)
1028 self.cursor['step'].addURL(link_label, link_url) 1032 link_alias = None
1033 if len(parts) == 2:
1034 link_alias, link_label = parts
1035
1036 self.cursor['links'].append((link_label, link_url, link_alias))
1037 if not link_alias:
1038 self.cursor['step'].addURL(link_label, link_url)
1039 else:
1040 self.cursor['step'].addAlias(link_label, link_url, text=link_alias)
1029 1041
1030 def handleOutputLine(self, line): 1042 def handleOutputLine(self, line):
1031 """This is called once with each line of the test log.""" 1043 """This is called once with each line of the test log."""
1032 # Handle initial setup here, as step_status might not exist yet at init. 1044 # Handle initial setup here, as step_status might not exist yet at init.
1033 self.initialSection() 1045 self.initialSection()
1034 1046
1035 annotator.MatchAnnotation(line.rstrip(), self) 1047 annotator.MatchAnnotation(line.rstrip(), self)
1036 1048
1037 def addLogLines(self, log_label, log_lines): 1049 def addLogLines(self, log_label, log_lines):
1038 self.cursor['annotated_logs'].setdefault(log_label, []).extend(log_lines) 1050 self.cursor['annotated_logs'].setdefault(log_label, []).extend(log_lines)
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 and starts to wait for remaining steps to finish. Returns command_result 1543 and starts to wait for remaining steps to finish. Returns command_result
1532 as Deferred.""" 1544 as Deferred."""
1533 self.scriptComplete(command_result) 1545 self.scriptComplete(command_result)
1534 steps_d = self.script_observer.waitForSteps() 1546 steps_d = self.script_observer.waitForSteps()
1535 # Ignore the waitForSteps' result and return the original result, 1547 # Ignore the waitForSteps' result and return the original result,
1536 # so the caller of runCommand receives command_result. 1548 # so the caller of runCommand receives command_result.
1537 steps_d.addCallback(lambda *_: command_result) 1549 steps_d.addCallback(lambda *_: command_result)
1538 return steps_d 1550 return steps_d
1539 d.addCallback(onCommandFinished) 1551 d.addCallback(onCommandFinished)
1540 return d 1552 return d
OLDNEW
« no previous file with comments | « masters/master.tryserver.chromium.perf/templates/build.html ('k') | scripts/master/unittests/annotator_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698