diff --git a/www/base/setup.py b/www/base/setup.py index 8ef3db60a80..5758648dda6 100644 --- a/www/base/setup.py +++ b/www/base/setup.py @@ -17,9 +17,11 @@ try: from buildbot_pkg import setup_www_plugin + import mock, buildbot except ImportError: + from setuptools import setup import sys - print >> sys.stderr, "Please install buildbot_pkg module in order to install that package, or use the pre-build .whl modules available on pypi" + print >> sys.stderr, "Please install buildbot, buildbot_pkg, and mock modules in order to install that package, or use the pre-build .whl modules available on pypi" sys.exit(1) setup_www_plugin( @@ -27,6 +29,7 @@ description='Buildbot UI', author=u'Pierre Tardy', author_email=u'tardyp@gmail.com', + setup_requires=['buildbot', 'buildbot_pkg', 'mock'], url='http://buildbot.net/', license='GNU GPL', packages=['buildbot_www'], diff --git a/www/waterfall_view/src/module/main.module.coffee b/www/waterfall_view/src/module/main.module.coffee index aef8cfd3391..5b3966e16a7 100644 --- a/www/waterfall_view/src/module/main.module.coffee +++ b/www/waterfall_view/src/module/main.module.coffee @@ -191,7 +191,7 @@ class Waterfall extends Controller ### # Returns the result string of a builder, build or step ### - result: (b) -> + getResultClassFromThing: (b) -> if not b.complete and b.started_at >= 0 result = 'pending' else @@ -211,7 +211,6 @@ class Waterfall extends Controller drawXAxis: -> x = @scale.getX(@builders, @getInnerWidth()) builderName = @scale.getBuilderName(@builders) - color = @result # Remove old axis @header.select('.axis.x').remove() @@ -252,7 +251,7 @@ class Waterfall extends Controller .attr('x2', 0) .attr('y1', x.rangeBand() / 2) .attr('y2', - x.rangeBand() / 2) - .attr('class', color) + .attr('class', self.getResultClassFromThing) .classed('stroke', true) # Y axis tick values @@ -328,7 +327,6 @@ class Waterfall extends Controller drawBuilds: -> x = @scale.getX(@builders, @getInnerWidth()) y = @scale.getY(@groups, @c.gap, @getInnerHeight()) - color = @result # Remove previous elements @chart.selectAll('.builder').remove() @@ -351,7 +349,7 @@ class Waterfall extends Controller # Draw rectangle for each build builds.append('rect') - .attr('class', color) + .attr('class', self.getResultClassFromThing) .attr('width', x.rangeBand()) .attr('height', (build) -> y(build.started_at) - y(build.complete_at)) .classed('fill', true) @@ -431,7 +429,7 @@ class Waterfall extends Controller .append('text') .attr('y', (step, i) -> 15 * (i + 1)) .attr('x', if r then 30 else 10) - .attr('class', (step, i) -> self.result(step)) + .attr('class', self.getResultClassFromThing) .classed('fill', true) .transition().delay(100) # Text format diff --git a/www/waterfall_view/src/module/main.module.spec.coffee b/www/waterfall_view/src/module/main.module.spec.coffee index 576975882b2..5be25b31942 100644 --- a/www/waterfall_view/src/module/main.module.spec.coffee +++ b/www/waterfall_view/src/module/main.module.spec.coffee @@ -109,9 +109,9 @@ describe 'Waterfall view controller', -> testBuild = complete: false started_at: 0 - expect(w.result(testBuild)).toBe('pending') + expect(w.getResultClassFromThing(testBuild)).toBe('pending') testBuild.complete = true - expect(w.result(testBuild)).toBe('unknown') + expect(w.getResultClassFromThing(testBuild)).toBe('unknown') results = 0: 'success' 1: 'warnings' @@ -121,4 +121,4 @@ describe 'Waterfall view controller', -> 5: 'cancelled' for i in [0..5] testBuild.results = i - expect(w.result(testBuild)).toBe(results[i]) \ No newline at end of file + expect(w.getResultClassFromThing(testBuild)).toBe(results[i])