[Buildbot-devel] My custom build step caused recursive death

Derek Graham (ML) derek.m.graham+ml at gmail.com
Wed Jan 26 10:31:51 UTC 2011


Ahh brain fail.

Thanks Axel.

Do you know how I could modify ShellCommand or probably LoggingBuildStep so
that I could pass a key through the logfiles parameter to automatically add
it as a HTML log? E.g.

logfiles = {"log1": {'filename': "/path/to/log1", 'html': True}, "log2":
"/path/to/log2"}

Cheers,

d


On 25 January 2011 18:03, Axel Hecht <l10n.moz at googlemail.com> wrote:

> That'd be python:
>
> >>> foo=['bar']
> >>> for f in foo:
> ...   print f
> ...   foo.append(f+"z")
> ...
>
> You can get away by
> for f in foo[:]:
> ...
>
> which is just creating a new list object.
>
> Whether what you do is right or not is a tad hard to tell from your
> example, as I don't see how you're getting your logs up anyway.
>
> Also, it may vary depending on buildbot version.
>
> If it'd work, it'd be way hacky still, of course ;-)
>
> Axel
>
> 2011/1/25 Derek Graham (ML) <derek.m.graham+ml at gmail.com<derek.m.graham%2Bml at gmail.com>
> >
>
>> I've got the following build step as I want to add the given log files to
>> display as HTML*:
>>
>> class MergeCoverageStep(shell.ShellCommand):
>>     def __init__(self, **kwargs):
>>         shell.ShellCommand.__init__(self, **kwargs)
>>
>>     def evaluateCommand(self, cmd):
>>         for l in self.step_status.getLogs():
>>             l.hide()
>>             self.addHTMLLog(l.getName() + ".html", l.getText())
>>
>>         return SUCCESS
>>
>> fr_factory.addStep(MergeCoverageStep(
>>         command = merge_cov_fr_cmd,
>>         logfiles = {"coverage_dashboard": "some/path/dashboard.html",
>>                     "coverage_hierarchy": "some/path/hierarchy.html",
>>                     "coverage_modlist"  : "some/path/modlist.html",
>>                     "coverage_groups"   : "some/path/groups.html",
>>                     "coverage_tests"    : "some/path/tests.html"})
>>                    )
>>
>> However, after it runs the buildmaster created about 10,000 twistd.logXXXX
>> files of about 1MB each and then died. Of the few twistd.log files I looked
>> at they contain:
>>
>> 2011-01-25 10:54:16+0000 [-]
>> addHTMLLog(coverage_tests.html.html.html.html.html.html.html.html.html.html.html.html.html.html.html.html.html.html.html.html.
>> .... etc
>>
>> What am I doing wrong?
>>
>> (The .hide() function is something I added to turn off display of the file
>> in the waterfall, which is useful when I don't want hundreds of log files
>> showing up in the waterfall display but do have them in the build details).
>>
>> Thanks,
>>
>> Derek
>>
>> * It would be nice to have an attribute to the logfiles dict like
>> 'follow': true called 'html' to do this automatically :) How would I go
>> about doing this? In LoggingBuildStep perhaps?
>>
>>
>> ------------------------------------------------------------------------------
>> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
>> Finally, a world-class log management solution at an even better
>> price-free!
>> Download using promo code Free_Logger_4_Dev2Dev. Offer expires
>> February 28th, so secure your free ArcSight Logger TODAY!
>> http://p.sf.net/sfu/arcsight-sfd2d
>> _______________________________________________
>> Buildbot-devel mailing list
>> Buildbot-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20110126/fc6973ad/attachment.html>


More information about the devel mailing list