view autobot/projects/mozmill/__init__.py @ 218:c82a46673ce9

show the entire log
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 21 Mar 2011 15:08:04 -0700
parents 312c4a76462a
children c989bbb323cd
line wrap: on
line source

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

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

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

    # setup the environment
    VirtualenvFactory.__init__(self, name='mozmill', 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
    FirefoxDownloaderFactory.__init__(self, platform=platform, base_url=firefox_url)

    # run the in-built tests
    self.addStep(ShellCommand(command=[WithProperties('%(mozmill)s'),
                                       '-b', WithProperties('%(firefox)s'),
                                       '-m',
                                       WithProperties('%(virtualenv)s/src/mozmill/mozmill/test/manifest.ini'),
                                       '--show-all'],
                              description='run mozmill internal tests'))

    # get the QA tests
    test_dir = tests.rsplit('/', 1)[-1]
    self.addStep(ShellCommand(command=['rm', '-rf', test_dir]))
    self.addStep(ShellCommand(command=['hg', 'clone', tests]))

    # run the QA tests
    
    # [TODO]