[Buildbot-commits] buildbot/buildbot/test test_properties.py,1.2,1.3
Brian Warner
warner at users.sourceforge.net
Tue May 23 16:29:58 UTC 2006
Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29493/buildbot/test
Modified Files:
test_properties.py
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-570
Creator: Brian Warner <warner at lothar.com>
fix 'buildnumber' property, add 'buildername' property
* docs/buildbot.texinfo (Build Properties): add 'buildername'
* buildbot/process/base.py (Build.setupStatus): oops, set
'buildername' and 'buildnumber' properties
* buildbot/test/test_properties.py (Interpolate.testBuildNumber):
test them
Index: test_properties.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_properties.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- test_properties.py 22 May 2006 00:35:26 -0000 1.2
+++ test_properties.py 23 May 2006 16:29:55 -0000 1.3
@@ -37,7 +37,7 @@
self.builder = FakeBuilder()
self.builder_status = builder.BuilderStatus("fakebuilder")
self.builder_status.basedir = "test_properties"
- self.builder_status.nextBuildNumber = 0
+ self.builder_status.nextBuildNumber = 5
rmdirRecursive(self.builder_status.basedir)
os.mkdir(self.builder_status.basedir)
self.build_status = self.builder_status.newBuild()
@@ -71,11 +71,11 @@
self.failUnlessEqual(cmd,
["tar", "czf", "build-foo.tar.gz", "source"])
- def testWithPropertiesMissing(self):
- self.build.setProperty("missing", None)
+ def testWithPropertiesEmpty(self):
+ self.build.setProperty("empty", None)
c = ShellCommand(workdir=dir, build=self.build,
command=["tar", "czf",
- WithProperties("build-%(missing)s.tar.gz"),
+ WithProperties("build-%(empty)s.tar.gz"),
"source"])
cmd = c._interpolateProperties(c.command)
self.failUnlessEqual(cmd,
@@ -106,6 +106,16 @@
self.failUnlessEqual(cmd,
["touch", "bot12-slave"])
+ def testBuildNumber(self):
+ c = ShellCommand(workdir=dir, build=self.build,
+ command=["touch",
+ WithProperties("build-%d", "buildnumber"),
+ WithProperties("builder-%s", "buildername"),
+ ])
+ cmd = c._interpolateProperties(c.command)
+ self.failUnlessEqual(cmd,
+ ["touch", "build-5", "builder-fakebuilder"])
+
run_config = """
from buildbot.process import step, factory
More information about the Commits
mailing list