[Buildbot-devel] SvnChangeSource was Re: RFC: more flexible web status display

Brian Warner warner-buildbot at lothar.com
Thu Apr 13 07:29:34 UTC 2006

From: "Niklaus Giger" <Niklaus.Giger at netstal.com>
> I will give it a try. Probably not in the next two days but before two weeks.


Look at buildbot/changes/p4poller.py to get started: you'll be creating a
twisted.application.service.Service subclass, and using a LoopingCall to get
the repeat-over-and-over behavior, which starts only after startService() has
been invoked. You'll need to use utils.getProcessOutput() just like in
p4poller to invoke "svn log --xml" correctly (without blocking the rest of
the buildmaster).

> I think the hardest part will be writing a test case using subversion.

I'd suggest collecting a couple of XML logfiles from subversion once, then
feeding *them* to the unit test instead of having it gather new ones by
invoking svn. Have the unit test validate that the correct set of Changes is
created and submitted in response to a given series of XML files. Don't worry
so much about having unit tests drive SVN, you can test that manually once.
Put the tests in test_changes.py .

Once that's done, maybe for extra credit, think about testing out the "svn
log --xml" portion. Do it in test_vc.py, against the SVN repository that is
created and modified there. In particular, grab the XML file right after the
repository's first revision is created, then grab another copy after the
second revision is created, then submit the two to the poller service just
like in the test_changes.py test case.


More information about the devel mailing list