[Buildbot-commits] buildbot/buildbot/test test_web.py,1.24,1.25

Brian Warner warner at users.sourceforge.net
Sat Nov 5 21:06:17 UTC 2005


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

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

add resubmit-build, change Step URLs

	* buildbot/interfaces.py (IBuilderControl.resubmitBuild): new
	method, takes an IBuildStatus and rebuilds it. It might make more
	sense to add this to IBuildControl instead, but that instance goes
	away completely once the build has finished, and resubmitting
	builds can take place weeks later.
	* buildbot/process/builder.py (BuilderControl.resubmitBuild): same
	* buildbot/status/html.py (StatusResourceBuild): also stash an
	IBuilderControl so we can use resubmitBuild.
	(StatusResourceBuild.body): render "resubmit" button if we can.
	Also add hrefs for each BuildStep
	(StatusResourceBuild.rebuild): add action for "resubmit" button
	(StatusResourceBuilder.getChild): give it an IBuilderControl

	* buildbot/status/builder.py (Status.getURLForThing): change the
	URL for BuildSteps to have a "step-" prefix, so the magic URLs
	that live as targets of buttons like "stop" and "rebuild" can't
	collide with them.
	* buildbot/status/builder.py (Status.getURLForThing): same
	* buildbot/status/html.py (StatusResourceBuild.getChild): same
	(StepBox.getBox): same
	* buildbot/test/test_web.py (GetURL): same
	(Logfile): same

	* buildbot/process/step.py (SVN.__init__): put svnurl/baseURL
	exclusivity checks after Source.__init__ upcall, so misspelled
	arguments will be reported more usefully
	(Darcs.__init__): same


Index: test_web.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- test_web.py	23 Oct 2005 06:10:07 -0000	1.24
+++ test_web.py	5 Nov 2005 21:06:15 -0000	1.25
@@ -342,9 +342,10 @@
         self.assertURLEqual(build, "b1/builds/0")
         # no page for builder.getEvent(-1)
         step = build.getSteps()[0]
-        self.assertURLEqual(step, "b1/builds/0/remote dummy") # really?
+        self.assertURLEqual(step, "b1/builds/0/step-remote dummy")
         # maybe page for build.getTestResults?
-        self.assertURLEqual(step.getLogs()[0], "b1/builds/0/remote dummy/0")
+        self.assertURLEqual(step.getLogs()[0],
+                            "b1/builds/0/step-remote dummy/0")
 
 
 
@@ -403,6 +404,10 @@
         step1.step_status.stepFinished(builder.SUCCESS)
         bs.buildFinished()
 
+    def getLogURL(self, stepname, lognum):
+        logurl = "http://localhost:%d/builder1/builds/0/step-%s/%d" \
+                 % (self.port, stepname, lognum)
+        return logurl
 
     def test_logfile1(self):
         d = client.getPage("http://localhost:%d/" % self.port)
@@ -413,7 +418,7 @@
         self.failUnless(page)
 
     def test_logfile2(self):
-        logurl = "http://localhost:%d/builder1/builds/0/setup/0" % self.port
+        logurl = self.getLogURL("setup", 0)
         d = client.getPage(logurl)
         d.addCallback(self._test_logfile2_1)
         return maybeWait(d)
@@ -421,7 +426,7 @@
         self.failUnless(logbody)
 
     def test_logfile3(self):
-        logurl = "http://localhost:%d/builder1/builds/0/setup/0" % self.port
+        logurl = self.getLogURL("setup", 0)
         d = client.getPage(logurl + "/text")
         d.addCallback(self._test_logfile3_1)
         return maybeWait(d)
@@ -429,7 +434,7 @@
         self.failUnlessEqual(logtext, "some stdout\n")
 
     def test_logfile4(self):
-        logurl = "http://localhost:%d/builder1/builds/0/setup/1" % self.port
+        logurl = self.getLogURL("setup", 1)
         d = client.getPage(logurl)
         d.addCallback(self._test_logfile4_1)
         return maybeWait(d)
@@ -442,7 +447,7 @@
         # twisted-1.3.0, fails to resume sending chunks after the client
         # stalls for a few seconds, because of a recursive doWrite() call
         # that was fixed in twisted-2.0.0
-        p = SlowReader("GET /builder1/builds/0/setup/2 HTTP/1.0\r\n\r\n")
+        p = SlowReader("GET /builder1/builds/0/step-setup/2 HTTP/1.0\r\n\r\n")
         f = CFactory(p)
         c = reactor.connectTCP("localhost", self.port, f)
         d = p.d
@@ -459,7 +464,7 @@
         # buildbot-0.6.6 dies as the NetstringReceiver barfs on the
         # saved logfile, because it was using one big chunk and exceeding
         # NetstringReceiver.MAX_LENGTH
-        p = SlowReader("GET /builder1/builds/0/setup/3 HTTP/1.0\r\n\r\n")
+        p = SlowReader("GET /builder1/builds/0/step-setup/3 HTTP/1.0\r\n\r\n")
         f = CFactory(p)
         c = reactor.connectTCP("localhost", self.port, f)
         d = p.d





More information about the Commits mailing list