view autobot/projects/mozbase/__init__.py @ 229:9513d73e0792

autobot tests now work
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 29 Nov 2011 20:39:45 -0800
parents d8172a7ba4b2
children 1084dadf9027
line wrap: on
line source

from autobot.process.factory import VirtualenvFactory
from buildbot.steps.shell import ShellCommand
from buildbot.steps.shell import WithProperties

class TestMozbase(VirtualenvFactory):
    """
    Base utilties for mozilla test harnesses:
    https://github.com/mozilla/mozbase
    """

    sources = {'git': ['https://github.com/mozilla/mozbase'],
               'hg': []}

    def __init__(self, platform=None):
        VirtualenvFactory.__init__(self)

        # setup for development
        self.addStep(ShellCommand(command=[WithProperties('%(python)s'), 'setup_development.py'], workdir=WithProperties('%(virtualenv)s/src/mozbase')))

        # add %(scripts)s to $PATH
        self.addScripts()

        # run the tests
        self.addStep(ShellCommand(command=[WithProperties('%(python)s'), 'test.py'], workdir=WithProperties('%(virtualenv)s/src/mozbase'),
                     env={'PATH': WithProperties('%(PATH)s')}))