view autobot/projects/mozmill/__init__.py @ 189:cb9ad0b04140

preliminary passing of platform information from slaves; not yet tested
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 02 Feb 2011 09:11:28 -0800
parents e15ccc0e1463
children 7789fe9f8c30
line wrap: on
line source

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

class TestMozmillFactory(VirtualenvFactory):
  """
  factory to test Mozmill
  http://github.com/mozautomation/mozmill
  """

  # VCS
  sources = {'git': ['http://github.com/mozautomation/mozmill.git']}
  
  def __init__(self, platform=None, git=None,
               tests='http://hg.mozilla.org/qa/mozmill-tests'):

    # setup the environment
    VirtualenvFactory.__init__(self, name='mozmill', platform=platform, git=git)
                               
    # currently, mozmill-tests are dealt with separately here
    # this is to avoid having mozmill depend on them or their changes
    # ideally, these would be even more specifiable

    # install mozmill in development mode
    # TODO: also install mozmill in `install` mode to ensure we didn't break that
    self.addStep(ShellCommand(command=[WithProperties('%(python)s'), 'setup_development.py'],
                              workdir=WithProperties('%(virtualenv)s/src/mozmill'),
                              description='setup_development.py'
                              ))

    # ensure mozmill works at all
    self.findScript('mozmill')
    self.addStep(ShellCommand(command=[WithProperties('%(mozmill)s'), '--help'],
                              description='mozmill --help'))
    
    # get firefox
    # [TODO]

    # run the in-built tests
    # TODO: see if these actually work!
    self.addStep(ShellCommand(command=[WithProperties('%(mozmill)s'),
                                       '-t',
                                       WithProperties('%(virtualenv)s/src/mozmill/mozmill/tests')],
                              description='run mozmill internal tests'))

    # get the QA tests
    self.addStep(ShellCommand(command=['hg', 'clone', tests]))

    # run the QA tests
    
    # [TODO]