Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 3f9ebee8620943b09026c8db6c1492ff > files > 99

buildbot-doc-0.8.5p1-1.fc15.noarch.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Build Factories &mdash; Buildbot v0.8.5rc2-29-g80a524b documentation</title>
    <link rel="stylesheet" href="../_static/agogo.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '0.8.5rc2-29-g80a524b',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../_static/buildbot.ico"/>
    <link rel="top" title="Buildbot v0.8.5rc2-29-g80a524b documentation" href="../index.html" />
    <link rel="up" title="Configuration" href="configuration.html" />
    <link rel="next" title="Properties" href="cfg-properties.html" />
    <link rel="prev" title="Builder Configuration" href="cfg-builders.html" /> 
  </head>
  <body>
    <div class="header-wrapper">
      <div class="header">
          <p class="logo"><a href="../index.html">
            <img class="logo" src="../_static/header-text-transparent.png" alt="Logo"/>
          </a></p>
        <h1><a href="../index.html">Buildbot v0.8.5rc2-29-g80a524b documentation</a></h1>
        <div class="rel">
          <a href="cfg-builders.html" title="Builder Configuration"
             accesskey="P">previous</a> |
          <a href="cfg-properties.html" title="Properties"
             accesskey="N">next</a> |
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a>
        </div>
       </div>
    </div>

    <div class="content-wrapper">
      <div class="content">
        <div class="document">
            
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="build-factories">
<span id="id1"></span><h1>Build Factories<a class="headerlink" href="#build-factories" title="Permalink to this headline">¶</a></h1>
<p>Each Builder is equipped with a <tt class="docutils literal"><span class="pre">build</span> <span class="pre">factory</span></tt>, which is defines the steps
used to perform that particular type of build.  This factory is created in the
configuration file, and attached to a Builder through the <tt class="docutils literal"><span class="pre">factory</span></tt> element
of its dictionary.</p>
<p>The steps used by these builds are defined in the next section, <a class="reference internal" href="cfg-buildsteps.html#build-steps"><em>Build Steps</em></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Build factories are used with builders, and are not added directly to the
buildmaster configuration dictionary.</p>
</div>
<span class="target" id="buildfactory"></span><div class="section" id="defining-a-build-factory">
<span id="index-0"></span><h2>Defining a Build Factory<a class="headerlink" href="#defining-a-build-factory" title="Permalink to this headline">¶</a></h2>
<p>A <tt class="xref py py-class docutils literal"><span class="pre">BuildFactory</span></tt> defines the steps that every build will follow.  Think of it as
a glorified script.  For example, a build factory which consists of a CVS checkout
followed by a <tt class="docutils literal"><span class="pre">make</span> <span class="pre">build</span></tt> would be configured as follows:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.steps</span> <span class="kn">import</span> <span class="n">svn</span><span class="p">,</span> <span class="n">shell</span>
<span class="kn">from</span> <span class="nn">buildbot.process</span> <span class="kn">import</span> <span class="n">factory</span>

<span class="n">f</span> <span class="o">=</span> <span class="n">factory</span><span class="o">.</span><span class="n">BuildFactory</span><span class="p">()</span>
<span class="n">f</span><span class="o">.</span><span class="n">addStep</span><span class="p">(</span><span class="n">svn</span><span class="o">.</span><span class="n">SVN</span><span class="p">(</span><span class="n">svnurl</span><span class="o">=</span><span class="s">&quot;http://..&quot;</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s">&quot;incremental&quot;</span><span class="p">))</span>
<span class="n">f</span><span class="o">.</span><span class="n">addStep</span><span class="p">(</span><span class="n">shell</span><span class="o">.</span><span class="n">Compile</span><span class="p">(</span><span class="n">command</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;make&quot;</span><span class="p">,</span> <span class="s">&quot;build&quot;</span><span class="p">]))</span>
</pre></div>
</div>
<p>This factory would then be attached to one builder (or several, if desired):</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span><span class="p">[</span><span class="s">&#39;builders&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
    <span class="n">BuilderConfig</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;quick&#39;</span><span class="p">,</span> <span class="n">slavenames</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;bot1&#39;</span><span class="p">,</span> <span class="s">&#39;bot2&#39;</span><span class="p">],</span> <span class="n">factory</span><span class="o">=</span><span class="n">f</span><span class="p">))</span>
</pre></div>
</div>
<p>It is also possible to pass a list of steps into the
<tt class="xref py py-class docutils literal"><span class="pre">BuildFactory</span></tt> when it is created. Using <tt class="xref py py-meth docutils literal"><span class="pre">addStep</span></tt> is
usually simpler, but there are cases where is is more convenient to
create the list of steps ahead of time, perhaps using some Python
tricks to generate the steps.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.steps</span> <span class="kn">import</span> <span class="n">source</span><span class="p">,</span> <span class="n">shell</span>
<span class="kn">from</span> <span class="nn">buildbot.process</span> <span class="kn">import</span> <span class="n">factory</span>

<span class="n">all_steps</span> <span class="o">=</span> <span class="p">[</span>
    <span class="n">source</span><span class="o">.</span><span class="n">CVS</span><span class="p">(</span><span class="n">cvsroot</span><span class="o">=</span><span class="n">CVSROOT</span><span class="p">,</span> <span class="n">cvsmodule</span><span class="o">=</span><span class="s">&quot;project&quot;</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s">&quot;update&quot;</span><span class="p">),</span>
    <span class="n">shell</span><span class="o">.</span><span class="n">Compile</span><span class="p">(</span><span class="n">command</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;make&quot;</span><span class="p">,</span> <span class="s">&quot;build&quot;</span><span class="p">]),</span>
<span class="p">]</span>
<span class="n">f</span> <span class="o">=</span> <span class="n">factory</span><span class="o">.</span><span class="n">BuildFactory</span><span class="p">(</span><span class="n">all_steps</span><span class="p">)</span>
</pre></div>
</div>
<p>Finally, you can also add a sequence of steps all at once:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">f</span><span class="o">.</span><span class="n">addSteps</span><span class="p">(</span><span class="n">all_steps</span><span class="p">)</span>
</pre></div>
</div>
<div class="section" id="attributes">
<h3>Attributes<a class="headerlink" href="#attributes" title="Permalink to this headline">¶</a></h3>
<p>The following attributes can be set on a build factory after it is created, e.g.,</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">f</span> <span class="o">=</span> <span class="n">factory</span><span class="o">.</span><span class="n">BuildFactory</span><span class="p">()</span>
<span class="n">f</span><span class="o">.</span><span class="n">useProgress</span> <span class="o">=</span> <span class="bp">False</span>
</pre></div>
</div>
<dl class="docutils">
<dt><tt class="xref py py-attr docutils literal"><span class="pre">useProgress</span></tt></dt>
<dd>(defaults to <tt class="xref docutils literal"><span class="pre">True</span></tt>): if <tt class="xref docutils literal"><span class="pre">True</span></tt>, the buildmaster keeps track of how long
each step takes, so it can provide estimates of how long future builds
will take. If builds are not expected to take a consistent amount of
time (such as incremental builds in which a random set of files are
recompiled or tested each time), this should be set to <tt class="xref docutils literal"><span class="pre">False</span></tt> to
inhibit progress-tracking.</dd>
<dt><tt class="xref py py-attr docutils literal"><span class="pre">workdir</span></tt></dt>
<dd><p class="first">(defaults to 'build'): workdir given to every build step created by
this factory as default. The workdir can be overridden in a build step
definition.</p>
<p class="last">If this attribute is set to a string, that string will be used for
constructing the workdir (buildslave base + builder builddir + workdir).
The attribute can also be a Python callable, for more complex cases, as
described in <a class="reference internal" href="customization.html#factory-workdir-functions"><em>Factory Workdir Functions</em></a>.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="predefined-build-factories">
<h2>Predefined Build Factories<a class="headerlink" href="#predefined-build-factories" title="Permalink to this headline">¶</a></h2>
<p>Buildbot includes a few predefined build factories that perform common build
sequences.  In practice, these are rarely used, as every site has slightly
different requirements, but the source for these factories may provide examples
for implementation of those requirements.</p>
<span class="target" id="gnuautoconf"></span><div class="section" id="index-1">
<span id="id2"></span><h3>GNUAutoconf<a class="headerlink" href="#index-1" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="buildbot.process.factory.GNUAutoconf">
<em class="property">class </em><tt class="descclassname">buildbot.process.factory.</tt><tt class="descname">GNUAutoconf</tt><a class="headerlink" href="#buildbot.process.factory.GNUAutoconf" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p><a class="reference external" href="http://www.gnu.org/software/autoconf/">GNU Autoconf</a> is a
software portability tool, intended to make it possible to write
programs in C (and other languages) which will run on a variety of
UNIX-like systems. Most GNU software is built using autoconf. It is
frequently used in combination with GNU automake. These tools both
encourage a build process which usually looks like this:</p>
<div class="highlight-bash"><div class="highlight"><pre>% <span class="nv">CONFIG_ENV</span><span class="o">=</span>foo ./configure --with-flags
% make all
% make check
<span class="c"># make install</span>
</pre></div>
</div>
<p>(except of course the Buildbot always skips the <tt class="docutils literal"><span class="pre">make</span> <span class="pre">install</span></tt>
part).</p>
<p>The Buildbot's <a class="reference internal" href="#buildbot.process.factory.GNUAutoconf" title="buildbot.process.factory.GNUAutoconf"><tt class="xref py py-class docutils literal"><span class="pre">buildbot.process.factory.GNUAutoconf</span></tt></a> factory is
designed to build projects which use GNU autoconf and/or automake. The
configuration environment variables, the configure flags, and command
lines used for the compile and test are all configurable, in general
the default values will be suitable.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">f</span> <span class="o">=</span> <span class="n">factory</span><span class="o">.</span><span class="n">GNUAutoconf</span><span class="p">(</span><span class="n">source</span><span class="o">=</span><span class="n">source</span><span class="o">.</span><span class="n">SVN</span><span class="p">(</span><span class="n">svnurl</span><span class="o">=</span><span class="n">URL</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s">&quot;copy&quot;</span><span class="p">),</span>
                        <span class="n">flags</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;--disable-nls&quot;</span><span class="p">])</span>
</pre></div>
</div>
<p>Required Arguments:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">source</span></tt></dt>
<dd>This argument must be a step specification tuple that provides a
BuildStep to generate the source tree.</dd>
</dl>
<p>Optional Arguments:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">configure</span></tt></dt>
<dd>The command used to configure the tree. Defaults to
<strong class="command">./configure</strong>. Accepts either a string or a list of shell argv
elements.</dd>
<dt><tt class="docutils literal"><span class="pre">configureEnv</span></tt></dt>
<dd>The environment used for the initial configuration step. This accepts
a dictionary which will be merged into the buildslave's normal
environment. This is commonly used to provide things like
<tt class="docutils literal"><span class="pre">CFLAGS=&quot;-O2</span> <span class="pre">-g&quot;</span></tt> (to turn off debug symbols during the compile).
Defaults to an empty dictionary.</dd>
<dt><tt class="docutils literal"><span class="pre">configureFlags</span></tt></dt>
<dd>A list of flags to be appended to the argument list of the configure
command. This is commonly used to enable or disable specific features
of the autoconf-controlled package, like <tt class="docutils literal"><span class="pre">[&quot;--without-x&quot;]</span></tt> to
disable windowing support. Defaults to an empty list.</dd>
<dt><tt class="docutils literal"><span class="pre">compile</span></tt></dt>
<dd>this is a shell command or list of argv values which is used to
actually compile the tree. It defaults to <tt class="docutils literal"><span class="pre">make</span> <span class="pre">all</span></tt>. If set to
<tt class="xref docutils literal"><span class="pre">None</span></tt>, the compile step is skipped.</dd>
<dt><tt class="docutils literal"><span class="pre">test</span></tt></dt>
<dd>this is a shell command or list of argv values which is used to run
the tree's self-tests. It defaults to &#64;code{make check}. If set to
None, the test step is skipped.</dd>
</dl>
<span class="target" id="basicbuildfactory"></span></div>
<div class="section" id="index-2">
<span id="id3"></span><h3>BasicBuildFactory<a class="headerlink" href="#index-2" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="buildbot.process.factory.BasicBuildFactory">
<em class="property">class </em><tt class="descclassname">buildbot.process.factory.</tt><tt class="descname">BasicBuildFactory</tt><a class="headerlink" href="#buildbot.process.factory.BasicBuildFactory" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>This is a subclass of <tt class="xref py py-class docutils literal"><span class="pre">GNUAutoconf</span></tt> which assumes the source is in CVS,
and uses <tt class="docutils literal"><span class="pre">mode='clobber'</span></tt>  to always build from a clean working copy.</p>
<span class="target" id="basicsvn"></span></div>
<div class="section" id="index-3">
<span id="id4"></span><h3>BasicSVN<a class="headerlink" href="#index-3" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="buildbot.process.factory.BasicSVN">
<em class="property">class </em><tt class="descclassname">buildbot.process.factory.</tt><tt class="descname">BasicSVN</tt><a class="headerlink" href="#buildbot.process.factory.BasicSVN" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>This class is similar to <tt class="xref py py-class docutils literal"><span class="pre">BasicBuildFactory</span></tt>, but uses SVN instead of CVS.</p>
<span class="target" id="quickbuildfactory"></span></div>
<div class="section" id="index-4">
<span id="id5"></span><h3>QuickBuildFactory<a class="headerlink" href="#index-4" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="buildbot.process.factory.QuickBuildFactory">
<em class="property">class </em><tt class="descclassname">buildbot.process.factory.</tt><tt class="descname">QuickBuildFactory</tt><a class="headerlink" href="#buildbot.process.factory.QuickBuildFactory" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>The <tt class="xref py py-class docutils literal"><span class="pre">QuickBuildFactory</span></tt> class is a subclass of <tt class="xref py py-class docutils literal"><span class="pre">GNUAutoconf</span></tt> which
assumes the source is in CVS, and uses <tt class="docutils literal"><span class="pre">mode='update'</span></tt> to get incremental
updates.</p>
<p>The difference between a <cite>full build</cite> and a <cite>quick build</cite> is that
quick builds are generally done incrementally, starting with the tree
where the previous build was performed. That simply means that the
source-checkout step should be given a <tt class="docutils literal"><span class="pre">mode='update'</span></tt> flag, to
do the source update in-place.</p>
<p>In addition to that, this class sets the <tt class="xref py py-attr docutils literal"><span class="pre">useProgress</span></tt> flag to <tt class="xref docutils literal"><span class="pre">False</span></tt>.
Incremental builds will (or at least the ought to) compile as few files as
necessary, so they will take an unpredictable amount of time to run. Therefore
it would be misleading to claim to predict how long the build will take.</p>
<p>This class is probably not of use to new projects.</p>
<span class="target" id="factory-cpan"></span></div>
<div class="section" id="cpan">
<span id="index-5"></span><h3>CPAN<a class="headerlink" href="#cpan" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="buildbot.process.factory.CPAN">
<em class="property">class </em><tt class="descclassname">buildbot.process.factory.</tt><tt class="descname">CPAN</tt><a class="headerlink" href="#buildbot.process.factory.CPAN" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Most Perl modules available from the <a class="reference external" href="http://www.cpan.org/">CPAN</a>
archive use the <tt class="docutils literal"><span class="pre">MakeMaker</span></tt> module to provide configuration,
build, and test services. The standard build routine for these modules
looks like:</p>
<div class="highlight-bash"><div class="highlight"><pre>% perl Makefile.PL
% make
% make <span class="nb">test</span>
<span class="c"># make install</span>
</pre></div>
</div>
<p>(except again Buildbot skips the install step)</p>
<p>Buildbot provides a <tt class="xref py py-class docutils literal"><span class="pre">CPAN</span></tt> factory to compile and test these
projects.</p>
<p>Arguments:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">source</span></tt></dt>
<dd>(required): A step specification tuple, like that used by <tt class="xref py py-class docutils literal"><span class="pre">GNUAutoconf</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">perl</span></tt></dt>
<dd>A string which specifies the <strong class="command">perl</strong> executable to use. Defaults
to just <strong class="command">perl</strong>.</dd>
</dl>
<span class="target" id="distutils"></span></div>
<div class="section" id="index-6">
<span id="id7"></span><h3>Distutils<a class="headerlink" href="#index-6" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="buildbot.process.factory.Distutils">
<em class="property">class </em><tt class="descclassname">buildbot.process.factory.</tt><tt class="descname">Distutils</tt><a class="headerlink" href="#buildbot.process.factory.Distutils" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Most Python modules use the <tt class="docutils literal"><span class="pre">distutils</span></tt> package to provide
configuration and build services. The standard build process looks
like:</p>
<div class="highlight-bash"><div class="highlight"><pre>% python ./setup.py build
% python ./setup.py install
</pre></div>
</div>
<p>Unfortunately, although Python provides a standard unit-test framework
named <tt class="docutils literal"><span class="pre">unittest</span></tt>, to the best of my knowledge <tt class="docutils literal"><span class="pre">distutils</span></tt>
does not provide a standardized target to run such unit tests. (Please
let me know if I'm wrong, and I will update this factory.)</p>
<p>The <tt class="xref py py-class docutils literal"><span class="pre">Distutils</span></tt> factory provides support for running the build
part of this process. It accepts the same <tt class="docutils literal"><span class="pre">source=</span></tt> parameter as
the other build factories.</p>
<p>Arguments:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">source</span></tt></dt>
<dd>(required): A step specification tuple, like that used by <tt class="xref py py-class docutils literal"><span class="pre">GNUAutoconf</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">python</span></tt></dt>
<dd>A string which specifies the <strong class="command">python</strong> executable to use. Defaults
to just <strong class="command">python</strong>.</dd>
<dt><tt class="docutils literal"><span class="pre">test</span></tt></dt>
<dd>Provides a shell command which runs unit tests. This accepts either a
string or a list. The default value is <tt class="xref docutils literal"><span class="pre">None</span></tt>, which disables the test
step (since there is no common default command to run unit tests in
distutils modules).</dd>
</dl>
<span class="target" id="trial"></span></div>
<div class="section" id="index-7">
<span id="id8"></span><h3>Trial<a class="headerlink" href="#index-7" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="buildbot.process.factory.Trial">
<em class="property">class </em><tt class="descclassname">buildbot.process.factory.</tt><tt class="descname">Trial</tt><a class="headerlink" href="#buildbot.process.factory.Trial" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Twisted provides a unit test tool named <strong class="command">trial</strong> which provides a
few improvements over Python's built-in <tt class="xref py py-mod docutils literal"><span class="pre">unittest</span></tt> module. Many
python projects which use Twisted for their networking or application
services also use trial for their unit tests. These modules are
usually built and tested with something like the following:</p>
<div class="highlight-bash"><div class="highlight"><pre>% python ./setup.py build
% <span class="nv">PYTHONPATH</span><span class="o">=</span>build/lib.linux-i686-2.3 trial -v PROJECTNAME.test
% python ./setup.py install
</pre></div>
</div>
<p>Unfortunately, the <tt class="file docutils literal"><span class="pre">build/lib</span></tt> directory into which the
built/copied <tt class="docutils literal"><span class="pre">.py</span></tt> files are placed is actually architecture-dependent,
and I do not yet know of a simple way to calculate its value. For many
projects it is sufficient to import their libraries <cite>in place</cite> from
the tree's base directory (<tt class="docutils literal"><span class="pre">PYTHONPATH=.</span></tt>).</p>
<p>In addition, the <tt class="samp docutils literal"><em><span class="pre">PROJECTNAME</span></em></tt> value where the test files are
located is project-dependent: it is usually just the project's
top-level library directory, as common practice suggests the unit test
files are put in the <tt class="xref py py-mod docutils literal"><span class="pre">test</span></tt> sub-module. This value cannot be
guessed, the <tt class="xref py py-class docutils literal"><span class="pre">Trial</span></tt> class must be told where to find the test
files.</p>
<p>The <tt class="xref py py-class docutils literal"><span class="pre">Trial</span></tt> class provides support for building and testing
projects which use distutils and trial. If the test module name is
specified, trial will be invoked. The library path used for testing
can also be set.</p>
<p>One advantage of trial is that the Buildbot happens to know how to
parse trial output, letting it identify which tests passed and which
ones failed. The Buildbot can then provide fine-grained reports about
how many tests have failed, when individual tests fail when they had
been passing previously, etc.</p>
<p>Another feature of trial is that you can give it a series of source
<tt class="docutils literal"><span class="pre">.py</span></tt> files, and it will search them for special <tt class="docutils literal"><span class="pre">test-case-name</span></tt>
tags that indicate which test cases provide coverage for that file.
Trial can then run just the appropriate tests. This is useful for
quick builds, where you want to only run the test cases that cover the
changed functionality.</p>
<p>Arguments:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">testpath</span></tt></dt>
<dd>Provides a directory to add to <span class="target" id="index-8"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PYTHONPATH</span></tt> when running the unit
tests, if tests are being run. Defaults to <tt class="docutils literal"><span class="pre">.</span></tt> to include the
project files in-place. The generated build library is frequently
architecture-dependent, but may simply be <tt class="file docutils literal"><span class="pre">build/lib</span></tt> for
pure-python modules.</dd>
<dt><tt class="docutils literal"><span class="pre">python</span></tt></dt>
<dd>which python executable to use. This list will form the start of
the <cite>argv</cite> array that will launch trial. If you use this,
you should set <tt class="docutils literal"><span class="pre">trial</span></tt> to an explicit path (like
<tt class="file docutils literal"><span class="pre">/usr/bin/trial</span></tt> or <tt class="file docutils literal"><span class="pre">./bin/trial</span></tt>). The parameter defaults
to <tt class="xref docutils literal"><span class="pre">None</span></tt>, which
leaves it out entirely (running <tt class="docutils literal"><span class="pre">trial</span> <span class="pre">args</span></tt> instead of
<tt class="docutils literal"><span class="pre">python</span> <span class="pre">./bin/trial</span> <span class="pre">args</span></tt>). Likely values are <tt class="docutils literal"><span class="pre">['python']</span></tt>,
<tt class="docutils literal"><span class="pre">['python2.2']</span></tt>, or <tt class="docutils literal"><span class="pre">['python',</span> <span class="pre">'-Wall']</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">trial</span></tt></dt>
<dd>provides the name of the <strong class="command">trial</strong> command. It is occasionally
useful to use an alternate executable, such as <strong class="command">trial2.2</strong> which
might run the tests under an older version of Python. Defaults to
<strong class="command">trial</strong>.</dd>
<dt><tt class="docutils literal"><span class="pre">trialMode</span></tt></dt>
<dd>a list of arguments to pass to trial, specifically to set the reporting mode.
This defaults to <tt class="docutils literal"><span class="pre">['--reporter=bwverbose']</span></tt>, which only works for
Twisted-2.1.0 and later.</dd>
<dt><tt class="docutils literal"><span class="pre">trialArgs</span></tt></dt>
<dd>a list of arguments to pass to trial, available to turn on any extra flags you
like. Defaults to <tt class="docutils literal"><span class="pre">[]</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">tests</span></tt></dt>
<dd>Provides a module name or names which contain the unit tests for this
project. Accepts a string, typically <tt class="samp docutils literal"><em><span class="pre">PROJECTNAME</span></em><span class="pre">.test</span></tt>, or a
list of strings. Defaults to <tt class="xref docutils literal"><span class="pre">None</span></tt>, indicating that no tests should be
run. You must either set this or <tt class="docutils literal"><span class="pre">testChanges</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">testChanges</span></tt></dt>
<dd>if <tt class="xref docutils literal"><span class="pre">True</span></tt>, ignore the <tt class="docutils literal"><span class="pre">tests</span></tt> parameter and instead ask the Build for all
the files that make up the Changes going into this build. Pass these filenames
to trial and ask it to look for test-case-name tags, running just the tests
necessary to cover the changes.</dd>
<dt><tt class="docutils literal"><span class="pre">recurse</span></tt></dt>
<dd>If <tt class="xref docutils literal"><span class="pre">True</span></tt>, tells Trial (with the <tt class="docutils literal"><span class="pre">--recurse</span></tt> argument) to look in all
subdirectories for additional test cases.</dd>
<dt><tt class="docutils literal"><span class="pre">reactor</span></tt></dt>
<dd>which reactor to use, like 'gtk' or 'java'. If not provided, the Twisted's
usual platform-dependent default is used.</dd>
<dt><tt class="docutils literal"><span class="pre">randomly</span></tt></dt>
<dd>If <tt class="xref docutils literal"><span class="pre">True</span></tt>, tells Trial (with the <tt class="docutils literal"><span class="pre">--random=0</span></tt> argument) to
run the test cases in random order, which sometimes catches subtle
inter-test dependency bugs. Defaults to <tt class="xref docutils literal"><span class="pre">False</span></tt>.</dd>
</dl>
<p>The step can also take any of the <tt class="xref py py-class docutils literal"><span class="pre">ShellCommand</span></tt> arguments, e.g.,
<tt class="xref py py-attr docutils literal"><span class="pre">haltOnFailure</span></tt>.</p>
<p>Unless one of <tt class="docutils literal"><span class="pre">tests</span></tt> or <tt class="docutils literal"><span class="pre">testChanges</span></tt> are set, the step will
generate an exception.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
        </div>
        <div class="sidebar">
<h3>Table Of Contents</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Buildbot Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Buildbot Manual</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="concepts.html">Concepts</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="configuration.html">Configuration</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="cfg-intro.html">Configuring Buildbot</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-global.html">Global Configuration</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-changesources.html">Change Sources</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-schedulers.html">Schedulers</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-buildslaves.html">Buildslaves</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-builders.html">Builder Configuration</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="">Build Factories</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="cfg-properties.html">Properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-buildsteps.html">Build Steps</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-interlocks.html">Interlocks</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-statustargets.html">Status Targets</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="customization.html">Customization</a></li>
<li class="toctree-l2"><a class="reference internal" href="cmdline.html">Command-line Tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="resources.html">Resources</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../developer/index.html">Buildbot Development</a></li>
</ul>

          <h3 style="margin-top: 1.5em;">Search</h3>
          <form class="search" action="../search.html" method="get">
            <input type="text" name="q" size="18" />
            <input type="submit" value="Go" />
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>
          <p class="searchtip" style="font-size: 90%">
            Enter search terms or a module, class or function name.
          </p>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

    <div class="footer-wrapper">
      <div class="footer">
        <div class="left">
          <a href="cfg-builders.html" title="Builder Configuration"
             >previous</a> |
          <a href="cfg-properties.html" title="Properties"
             >next</a> |
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |
          <a href="../genindex.html" title="General Index"
             >index</a>
            <br/>
            <a href="../_sources/manual/cfg-buildfactories.txt"
               rel="nofollow">Show Source</a>
        </div>

        <div class="right">
          
    <div class="footer">
        &copy; Copyright Buildbot Team Members.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

  </body>
</html>