WARNING:

This document is not complete yet. When this warning disappears, that will mean the document is ready.

# The Subversion Build/Test Farm

    $LastChangedDate: 2005-12-13 19:49:17 +0000 (Tue, 13 Dec 2005) $

We are designing a build/test farm for Subversion, to test portability more conveniently and consistently. We hope this will lead to fewer surprises at Release Candidate time.

This document describes the build farm. The intended audiences are:

- People who want to join the build farm, by running Subversion builds on a box with a stable environment, and using the build farm client software to send result reports to the central server for publication.
- People who administer the central build server (CollabNet's operations team has volunteered to do this, as well as to run some of the clients).
- Developers who want to test a change's portability before committing it, using the build farm's "try with this patch" feature.

## Overview

We've tentatively decided to use BuildBot for build management software, in part because of its TryScheduler feature, which lets a developer ask the question "What would happen if I committed this patch right now?". It runs the unit test suite (across multiple build platforms) on the developer's current code, allowing her to make sure her changes will not break the tree when she finally commits them. The default setup, however, is to build a repository tree, usually trunk, or a release branch or tag.

BuildBot uses two terms, buildmaster and buildslave, that mean exactly what you think they do. There is typically one buildmaster, and multiple buildslaves. Most people will want to read about buildslave configuration, which tells how to set up a buildslave client. Buildmaster setup is covered here, but is probably of interest only to the CollabNet administrators who run the buildmaster server.

## Buildslave

1. Install all the dependencies required to build Subversion from working copy source. That's outside the scope of this document, but see http://svn.collab.net/repos/svn/trunk/INSTALL for details.

2. Create a user buildslave on your system. The buildslave client will use this user, instead of your regular development user. This is partly for security reasons, but also because part of the point of the build farm is to make sure things work in a relatively untweaked environment.

3. Create a directory in ~buildslave/ to be the base directory for Subversion builds, hereinafter known as the "BASEDIR". For example, ~buildslave/subversion-builds/. The buildslave will touch nothing outside this directory.

4. Write a script that checks out a copy of trunk (or whatever branch or tag you want to build), runs configure, make, make check, make davcheck, make svncheck, etc. Make sure the build works without manual intervention. Otherwise, it will not work when BuildBot attempts to do it automatically.

   We recommend having that script live in BASEDIR, and having it check out the working copy such that it creates a new subdirectory within BASEDIR.

   As rooneg pointed out, we should just advise people to use http://svn.collab.net/repos/svn/trunk/tools/test-scripts/svntest instead. But first, need to make sure that works... it may need some modifications to cooperate with the build farm system, as opposed to the breakage list.

5. Obtain your slavename and password from the central administrator.

   Document exactly who to contact and how.

6. Initialize the buildslave (the BuildBot docs call this "creating" the buildslave):

          buildbot slave BASEDIR MASTERHOST:PORT SLAVENAME PASSWORD

7. Fill in your "hostinfo files", so other people can see the environment your builds run in, and can contact you if something appears to be wrong. BASEDIR/info/admin should contain your name and email address. This will be visible from the build status page; you can munge it to protect from spam address harvesters. BASEDIR/info/host should contain a description of the host: OS, version, memory size, CPU speed, versions of relevant libraries installed, and the version of the buildbot code which is running the buildslave.

   Give examples of these files.

   If you run many buildslaves, you may want to create a single ~buildslave/info file and share it among all the buildslaves with symlinks.

## Buildmaster

BuildBot uses the usual Python installation mechanism, and depends on the TwistedMatrix library. If you happen to use Debian GNU/Linux, you can set these up very easily:

       # apt-get update
       # apt-get install python2.3-dev
       # apt-get install twisted

Just follow the instructions at http://buildbot.sourceforge.net/manual-0.7.0.html#Installation

...working here...

## Trying out a change

...working here...

## References

- BuildBot:
  http://buildbot.sourceforge.net/ (start here)
  http://buildbot.sourceforge.net/PyCon-2003/buildbot.html (great technical overview)
  https://sourceforge.net/projects/buildbot/
  http://buildbot.sourceforge.net/manual-0.7.0.html

- Original mail about the system:

         http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=109179
         From: Karl Fogel <kfogel@collab.net>
         To: dev@subversion.tigris.org
         Subject: Helping CollabNet provide an automated build farm for Subversion.
         Date: Mon, 28 Nov 2005 15:09:48 -0600 (CST)
         Message-Id: <200511282109.jASL9m287485@newton.ch.collab.net>

  Direct thread link:

         http://subversion.tigris.org/servlets/BrowseList?list=dev&by=thread&from=398579