Skip to content

Commit

Permalink
Implement requested change to from a <pre> to a <div> for builder des…
Browse files Browse the repository at this point in the history
…criptions, fix tests broken by addition of builder descriptions.
  • Loading branch information
brycelelbach committed Oct 28, 2012
1 parent dad3bf9 commit 71b8281
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions master/buildbot/config.py
Expand Up @@ -714,6 +714,8 @@ def getConfigDict(self):
rv['properties'] = self.properties
if self.mergeRequests:
rv['mergeRequests'] = self.mergeRequests
if self.description:
rv['description'] = self.description
return rv


Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/status/web/templates/builder.html
Expand Up @@ -9,7 +9,7 @@ <h1>Builder {{ name }}</h1>
<p>(<a href="{{ path_to_root }}waterfall?show={{ name }}">view in waterfall</a>)</p>

{% if description %}
<pre>{{ description }}</pre>
<div class="BuilderDescription">{{ description }}</div>
{% endif %}

<div class="column">
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/test/fake/fakemaster.py
Expand Up @@ -50,7 +50,7 @@ class FakeBotMaster(object):

class FakeStatus(object):

def builderAdded(self, name, basedir, category=None):
def builderAdded(self, name, basedir, category=None, description=None):
return FakeBuilderStatus()


Expand Down
13 changes: 9 additions & 4 deletions master/buildbot/test/unit/test_config.py
Expand Up @@ -956,14 +956,16 @@ def test_defaults(self):
locks=[],
env={},
properties={},
mergeRequests=None)
mergeRequests=None,
description=None)

def test_args(self):
cfg = config.BuilderConfig(
name='b', slavename='s1', slavenames='s2', builddir='bd',
slavebuilddir='sbd', factory=self.factory, category='c',
nextSlave=lambda : 'ns', nextBuild=lambda : 'nb', locks=['l'],
env=dict(x=10), properties=dict(y=20), mergeRequests='mr')
env=dict(x=10), properties=dict(y=20), mergeRequests='mr',
description='buzz')
self.assertIdentical(cfg.factory, self.factory)
self.assertAttributes(cfg,
name='b',
Expand All @@ -974,7 +976,8 @@ def test_args(self):
locks=['l'],
env={'x':10},
properties={'y':20},
mergeRequests='mr')
mergeRequests='mr',
description='buzz')

def test_getConfigDict(self):
ns = lambda : 'ns'
Expand All @@ -983,9 +986,11 @@ def test_getConfigDict(self):
name='b', slavename='s1', slavenames='s2', builddir='bd',
slavebuilddir='sbd', factory=self.factory, category='c',
nextSlave=ns, nextBuild=nb, locks=['l'],
env=dict(x=10), properties=dict(y=20), mergeRequests='mr')
env=dict(x=10), properties=dict(y=20), mergeRequests='mr',
description='buzz')
self.assertEqual(cfg.getConfigDict(), {'builddir': 'bd',
'category': 'c',
'description': 'buzz',
'env': {'x': 10},
'factory': self.factory,
'locks': ['l'],
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/test/unit/test_status_builder_cache.py
Expand Up @@ -24,10 +24,10 @@ class TestBuildStatus(unittest.TestCase):
# that buildstep.BuildStepStatus is never instantiated here should tell you
# that these classes are not well isolated!

def setupBuilder(self, buildername, category=None):
def setupBuilder(self, buildername, category=None, description=None):
m = fakemaster.make_master()
b = builder.BuilderStatus(buildername=buildername, category=category,
master=m)
master=m, description=description)
# Awkwardly, Status sets this member variable.
b.basedir = os.path.abspath(self.mktemp())
os.mkdir(b.basedir)
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/test/unit/test_status_buildstep.py
Expand Up @@ -23,11 +23,11 @@ class TestBuildStepStatus(unittest.TestCase):
# that buildstep.BuildStepStatus is never instantiated here should tell you
# that these classes are not well isolated!

def setupBuilder(self, buildername, category=None):
def setupBuilder(self, buildername, category=None, description=None):
self.master = fakemaster.make_master()
self.master.basedir = '/basedir'

b = builder.BuilderStatus(buildername, self.master, category)
b = builder.BuilderStatus(buildername, self.master, category, description)
b.master = self.master
# Ackwardly, Status sets this member variable.
b.basedir = os.path.abspath(self.mktemp())
Expand Down

0 comments on commit 71b8281

Please sign in to comment.