[Buildbot-devel] Chaining two commands in the Test build step

SZENTE Balint balint at szentedwg.ro
Tue Oct 11 06:32:31 UTC 2011


Thanks for your prompt reply.

I made it the following way:

class UnitTest(Test):
  def createSummary(self, log):
    # Quick & dirty hardcoded key to get the XML buffer
    buffer = self.cmd.logs['report'].getText()
    html_buffer = xslt_transform(buffer, stylesheet)
    self.addHTMLLog('report.html', html_buffer)

...

f.addStep(UnitTest(command=["scons", "-k", "unit.test"], \
  logfiles={"report": "unit_test.xml"}))

This seems to work, but the step will have 3 log files:
 * stdio
 * report (the raw XML file in HTML form, like any text log)
 * report.html (the correct transformed XML document)

I would like to ask the following questions:

 1. How can I delete "report"? I would like to store on disk and showin
 the step only the "stdio" and "report.html" files. Is it OK/enough to
 just delete from the self.cmd.logs dictionary the element with
 "report" key and to delete the corresponding file from the disk?

 2. createSummary is called only for 'stdio' log for a command, right?

 3. What would be the best/preferred method to get the whole raw XML
 content/buffer in the createSummary() function?

Thanks,
Balint

On Mon, 10 Oct 2011 10:41:05 -0400
Tom Prince <tom.prince at ualberta.net> wrote:

> On Mon, 10 Oct 2011 13:10:06 +0300, SZENTE Balint
> <balint at szentedwg.ro> wrote:
> > I'm using the *Test* build step to run all the unit tests for a
> > project. Basically it is just a shell command that runs a python
> > script. This generates an XML report file.
> > 
> > I would like to do the following:
> >  * insert somehow a RemoteCommand with uploadFile after the
> >    RemoteShellCommand is finished to get the XML report file in
> > memory
> You could probably do this by marking the file as a log file.
> >  * transform this XML data into HTML by XSLT
> >  * add as self.addHTMLLog('report', html_buffer) in order to
> > display the HTML report (similar to normal plain text logs with the
> > *logfiles* argument)
> 
> This would probably best be done in createSummary.
> 
>   Tom





More information about the devel mailing list