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

Unified Diff: scripts/master/unittests/annotator_test.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/master/chromium_step.py ('k') | third_party/buildbot_8_4p1/buildbot/status/buildstep.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/unittests/annotator_test.py
diff --git a/scripts/master/unittests/annotator_test.py b/scripts/master/unittests/annotator_test.py
index fee77962847545fa13b39a2594298f34ac0b8347..7d742b7e8de242d25ae12eae82d39ef6aecdc139 100755
--- a/scripts/master/unittests/annotator_test.py
+++ b/scripts/master/unittests/annotator_test.py
@@ -71,6 +71,7 @@ class FakeBuildstepStatus(mock.Mock):
mock.Mock.__init__(self)
self.name = name
self.urls = {}
+ self.aliases = {}
self.build = build
self.text = None
self.step = None
@@ -96,9 +97,15 @@ class FakeBuildstepStatus(mock.Mock):
def getURLs(self):
return self.urls.copy()
+ def getAliases(self):
+ return self.aliases.copy()
+
def addURL(self, label, url):
self.urls[label] = url
+ def addAlias(self, label, url, text=None):
+ self.aliases.setdefault(label, []).append((text, url))
+
def addLog(self, log):
l = FakeLog(log)
self.logs.append(l)
@@ -217,7 +224,7 @@ class AnnotatorCommandsTest(unittest.TestCase):
def testStepLink(self):
self.handleOutputLine('@@@STEP_LINK@label@http://localhost/@@@')
- testurls = [('label', 'http://localhost/')]
+ testurls = [('label', 'http://localhost/', None)]
testurl_hash = {'label': 'http://localhost/'}
annotatedLinks = [x['links'] for x in self.step.script_observer.sections]
@@ -227,6 +234,18 @@ class AnnotatorCommandsTest(unittest.TestCase):
self.assertEquals(annotatedLinks, [testurls])
self.assertEquals(stepLinks, [testurl_hash])
+ def testStepAlias(self):
+ self.handleOutputLine('@@@STEP_LINK@alias-->label@http://localhost/@@@')
+ testurls = [('label', 'http://localhost/', 'alias')]
+ testalias_hash = {'label': [('alias', 'http://localhost/')]}
+
+ annotatedLinks = [x['links'] for x in self.step.script_observer.sections]
+ stepAliases = [x['step'].getAliases() for x in
+ self.step.script_observer.sections]
+
+ self.assertEquals(annotatedLinks, [testurls])
+ self.assertEquals(stepAliases, [testalias_hash])
+
def testStepWarning(self):
self.handleOutputLine('@@@STEP_WARNINGS@@@')
self.handleOutputLine('@@@BUILD_STEP step@@@')
« no previous file with comments | « scripts/master/chromium_step.py ('k') | third_party/buildbot_8_4p1/buildbot/status/buildstep.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698