view autobot/projects/mozbase/__init__.py @ 235:95be44a09047

pass the git part along to virtualenvfactory
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 22 Dec 2011 13:48:27 -0800
parents 1084dadf9027
children
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': ['git://github.com/mozilla/mozbase.git'],
               'hg': []}

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

        # 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')}))