[Buildbot-commits] buildbot/buildbot/test test_web.py,1.13,1.14

Brian Warner warner at users.sourceforge.net
Thu May 12 21:16:51 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7726/buildbot/test

Modified Files:
	test_web.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-163
Creator:  Brian Warner <warner at monolith.lothar.com>

add (failing) test: html.Waterfall hates OfflineLogFile

* buildbot/test/test_web.py (WebTest.test_logfile): Add a test to
point out that OfflineLogFile does not currently work with
html.Waterfall . Fixing this is high-priority.


Index: test_web.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- test_web.py	4 May 2005 07:04:17 -0000	1.13
+++ test_web.py	12 May 2005 21:16:49 -0000	1.14
@@ -12,8 +12,9 @@
 from twisted.web import client
 
 from buildbot import master, interfaces
-from buildbot.status import html
+from buildbot.status import html, builder
 from buildbot.changes.changes import Change
+from buildbot.process import step, base
 
 class ConfiguredMaster(master.BuildMaster):
     """This BuildMaster variant has a static config file, provided as a
@@ -207,3 +208,50 @@
                           "my-maildir</li>", changes)
 
         dr(m.stopService())
+
+    def test_logfile(self):
+        config = """
+from buildbot.status import html
+from buildbot.process.factory import BasicBuildFactory
+f1 = BasicBuildFactory('cvsroot', 'cvsmodule')
+BuildmasterConfig = {
+    'bots': [('bot1', 'passwd1')],
+    'sources': [],
+    'builders': [{'name': 'builder1', 'slavename': 'bot1',
+                  'builddir':'workdir', 'factory':f1}],
+    'slavePortnum': 0,
+    'status': [html.Waterfall(http_port=0)],
+    }
+"""
+        os.mkdir("test_web5")
+        m = ConfiguredMaster("test_web5", config)
+        m.startService()
+        # hack to find out what randomly-assigned port it is listening on
+        port = list(self.find_waterfall(m)[0])[0]._port.getHost().port
+        # insert an event
+
+        s = m.status.getBuilder("builder1")
+        bs = s.newBuild()
+        build1 = base.Build()
+        step1 = step.BuildStep(build=build1)
+        step1.name = "setup"
+        bs.addStep(step1)
+        bs.buildStarted(build1)
+        step1.step_status.stepStarted()
+        loog = step1.addLog("output")
+        loog.addStdout("some stdout\n")
+        loog.finish()
+        step1.step_status.stepFinished(builder.SUCCESS)
+        bs.buildFinished()
+
+        d = client.getPage("http://localhost:%d/" % port)
+        page = dr(d)
+        self.failUnless(page)
+
+        logurl = "http://localhost:%d/builder1/builds/0/setup/0" % port
+        d = client.getPage(logurl)
+        logbody = dr(d)
+        self.failUnless(logbody)
+        d = client.getPage(logurl + "/text")
+        logtext = dr(d)
+        self.failUnlessEqual(logtext, "some stdout\n")





More information about the Commits mailing list