From 49135dfd243aff750fcb8049f75fd73635246525 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 12 Nov 2011 13:06:37 -0800 Subject: [PATCH] Buildbot runs unit tests! Yay! --- .../buildbot_config/master/builders.py | 7 ++++- .../buildbot_config/master/buildsteps.py | 26 ++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/test/buildbot/buildbot_config/master/builders.py b/test/buildbot/buildbot_config/master/builders.py index 1dcb05dde..1c983e6ad 100644 --- a/test/buildbot/buildbot_config/master/builders.py +++ b/test/buildbot/buildbot_config/master/builders.py @@ -17,7 +17,12 @@ def get_builders(slaves): slaves. """ f = BuildFactory() - # TODO + f.addStep(Git(repourl="git://github.com/mitchellh/vagrant.git", + mode="full", + method="fresh", + shallow=True)) + f.addStep(buildsteps.Bundler()) + f.addStep(buildsteps.UnitTests()) return [BuilderConfig( name="vagrant-master", diff --git a/test/buildbot/buildbot_config/master/buildsteps.py b/test/buildbot/buildbot_config/master/buildsteps.py index 4431bef32..a9cf5ee28 100644 --- a/test/buildbot/buildbot_config/master/buildsteps.py +++ b/test/buildbot/buildbot_config/master/buildsteps.py @@ -4,4 +4,28 @@ Contains various buildsteps that the build master uses. import os -# TODO +from buildbot.steps.shell import ShellCommand + +class Bundler(ShellCommand): + """ + Runs bundler to get the dependencies for a Ruby project. + """ + + name = "bundler" + description = "bundle install" + descriptionDone = "bundler install complete" + command = ["bundle", "install"] + flunkOnFailure = True + haltOnFailure = True + +class UnitTests(ShellCommand): + """ + Runs the unit tests via a rake command. + """ + + name = "unit tests" + description = "unit tests" + descriptionDone = "passed unit tests" + command = ["rake", "test:unit"] + flunkOnFailure = True + haltOnFailure = True