Skip to content

Automated Testing (Buildbot)

gkanwar edited this page Nov 14, 2011 · 11 revisions

Overview

Our automated testing it currently run though Buildbot. Buildbot is a master/slave system. This means there is a master process running somewhere which manages all the build slaves, testers, schedulers, etc. Then there are individual slave processes, potentially running on completely different machines (as is the case in LU's set up), which connect to the master and perform actions as and when the master process tells them to.

In the case of LU's testing setup, the master process is at diogenes.learningu.org:9580. We currently have the following slaves set up:

  • hippo-slave -- Running on hippo.learningu.org, an Ubuntu VM.

(Updated 11/14/11 by Gurtej)

Pretty much all the documentation you need regarding Buildbot can be found in Buildbot's documentation on their site: http://buildbot.net/buildbot/docs/current/index.html.

Setting up a new slave

Configure the master

First, you need to tell the master to look for the buildslave that we're going to create, and create a username and password for it. You do this by editing /lu/buildbot/master/master.cfg. Find the lines that say:

# the 'slaves' list defines the set of allowable buildslaves. Each element is
# a BuildSlave object, which is created with bot-name, bot-password.  These
# correspond to values given to the buildslave's mktap invocation.
from buildbot.buildslave import BuildSlave
c['slaves'] = [BuildSlave("someslave", "somepass", max_builds=1),
               BuildSlave("anotherslave", "somepass", max_builds=1),]

You need to add another BuildSlave object to the list of BuildSlaves. To do this, add to this list the following (setting your own name and password): BuildSlave("slave-username", "slave-pass", max_builds=1).

You have changed the master configuration file, but the master doesn't know this until you tell it so by going up a directory (cd ..), and calling sudo buildbot reconfig master, where master is the name of the directory containing your master process (in the case of LU it is just 'master').

Create the slave

Now you need to create the slave and connect it to the master process.

It may be useful to have the buildslave running in a python virtual environment. If you wish to do this, make sure virtualenv is installed, then activate the buildbot directory. To use the example of Hippo, you would cd to /mnt/ebs/buildbot then run virtualenv --no-site-packages sandbox and source sandbox/bin/activate.

Now create your buildslave: buildslave create-slave [slave-name] [master-location] [slave-username] [slave-password] where slave-username and slave-password are the same as the ones you added to master.cfg earlier. In the case of hippo: buildslave create-slave hippo-slave diogenes.learningu.org:9580 hippo-slave [hippo's password]. Then run the buildbot: buildslave start [slave-name] to start the buildslave process. In the case of hippo: buildslave start hippo-slave. This should connect with no errors and print a message saying that the slave attached. Congratulations, you've successfully set up your buildslave!

Clone this wiki locally