1
2
3 from buildbot import util
4 from buildbot.process.base import Build
5 from buildbot.process.buildstep import BuildStep
6 from buildbot.steps.source import CVS, SVN
7 from buildbot.steps.shell import Configure, Compile, Test, PerlModuleTest
8
9
10 -def s(steptype, **kwargs):
11
12
13 return (steptype, kwargs)
14
16 """When calling BuildFactory.addStep(stepinstance), addStep() only takes
17 one argument. You passed extra arguments to addStep(), which you probably
18 intended to pass to your BuildStep constructor instead. For example, you
19 should do::
20
21 f.addStep(ShellCommand(command=['echo','stuff'], haltOnFailure=True))
22
23 instead of::
24
25 f.addStep(ShellCommand(command=['echo','stuff']), haltOnFailure=True)
26 """
27
29 """
30 @cvar buildClass: class to use when creating builds
31 @type buildClass: L{buildbot.process.base.Build}
32 """
33 buildClass = Build
34 useProgress = 1
35 workdir = "build"
36 compare_attrs = ['buildClass', 'steps', 'useProgress', 'workdir']
37
42
47
57
58 - def addStep(self, step_or_factory, **kwargs):
59 if isinstance(step_or_factory, BuildStep):
60 if kwargs:
61 raise ArgumentsInTheWrongPlace()
62 s = step_or_factory.getStepFactory()
63 elif type(step_or_factory) == type(BuildStep) and \
64 issubclass(step_or_factory, BuildStep):
65 s = (step_or_factory, dict(kwargs))
66 else:
67 raise ValueError('%r is not a BuildStep nor BuildStep subclass' % step_or_factory)
68 self.steps.append(s)
69
73
74
75
77 - def __init__(self, source, configure="./configure",
78 configureEnv={},
79 configureFlags=[],
80 compile=["make", "all"],
81 test=["make", "check"]):
101
102 -class CPAN(BuildFactory):
103 - def __init__(self, source, perl="perl"):
108
110 - def __init__(self, source, python="python", test=None):
115
116 -class Trial(BuildFactory):
117 """Build a python module that uses distutils and trial. Set 'tests' to
118 the module in which the tests can be found, or set useTestCaseNames=True
119 to always have trial figure out which tests to run (based upon which
120 files have been changed).
121
122 See docs/factories.xhtml for usage samples. Not all of the Trial
123 BuildStep options are available here, only the most commonly used ones.
124 To get complete access, you will need to create a custom
125 BuildFactory."""
126
127 trial = "trial"
128 randomly = False
129 recurse = False
130
131 - def __init__(self, source,
132 buildpython=["python"], trialpython=[], trial=None,
133 testpath=".", randomly=None, recurse=None,
134 tests=None, useTestCaseNames=False, env=None):
135 BuildFactory.__init__(self, [source])
136 assert tests or useTestCaseNames, "must use one or the other"
137 if trial is not None:
138 self.trial = trial
139 if randomly is not None:
140 self.randomly = randomly
141 if recurse is not None:
142 self.recurse = recurse
143
144 from buildbot.steps.python_twisted import Trial
145 buildcommand = buildpython + ["./setup.py", "build"]
146 self.addStep(Compile, command=buildcommand, env=env)
147 self.addStep(Trial,
148 python=trialpython, trial=self.trial,
149 testpath=testpath,
150 tests=tests, testChanges=useTestCaseNames,
151 randomly=self.randomly,
152 recurse=self.recurse,
153 env=env,
154 )
155
156
157
158
159
160
161 ConfigurableBuildFactory = BuildFactory
162
164
165
166 - def __init__(self, cvsroot, cvsmodule,
167 configure=None, configureEnv={},
168 compile="make all",
169 test="make check", cvsCopy=False):
178
180 useProgress = False
181
182 - def __init__(self, cvsroot, cvsmodule,
183 configure=None, configureEnv={},
184 compile="make all",
185 test="make check", cvsCopy=False):
192
194
195 - def __init__(self, svnurl,
196 configure=None, configureEnv={},
197 compile="make all",
198 test="make check"):
204