[Buildbot-devel] CVS change source

Dustin J. Mitchell dustin at zmanda.com
Thu Jul 8 03:38:11 UTC 2010


On Wed, Jul 7, 2010 at 9:49 PM, Andy Howell <AndyHowell at austin.rr.com> wrote:
> I need a some advice on constructing the tests. On the CVS side of things, my
> buildbot-cvs-mail script is executed by CVS. Its passed some command line args, forks,
> reads from stdin, and sends a mail via a smtplib.SMTP() connection.
> Making a full test that goes through the mail server is a bit problematic. I could make
> simple mock for the 3 smtplib methods that are used and send the results to stdout when
> testing. I've got driver script sends fake CVS output, though it does not read the mail
> generated.

Mocking out the SMTP calls and running it in a test harness sounds
like a perfect plan.

> The buildbot side is more difficult for me. I created a new subsclass of MailDirSource
> called BuiltbotCVSMaildirSource. It just implements the parse method.

If the only addition is the parse() method, then just call that method
with various inputs and verify that it produces the correct outputs,
using mocks or monkeypatches as necessary to avoid invoking all of the
buildmaster's machinery.

> At the top of mail.py, I see:
>
> # -*- test-case-name: buildbot.test.test_mailparse -*-
>
> but don't see a test_mailparse anywhere. Is that just a placeholder?

It's just a leftover - I should go through and remove those.

Dustin

-- 
Open Source Storage Engineer
http://www.zmanda.com




More information about the devel mailing list