Bug 1055926: Add mozinfo packages to the virtualenv for mozmill, r=Standard8 CLOSED TREE
--- a/mail/test/mozmill/Makefile.in
+++ b/mail/test/mozmill/Makefile.in
@@ -51,17 +51,17 @@ libs::
VIRTUALENV_DIR = $(_DEST_DIR)/../mozmill-virtualenv
mozmill-virtualenv: NSDISTMODE=copy
mozmill-virtualenv:
$(INSTALL) $(topsrcdir)/mail/test/resources $(_DEST_DIR)
$(INSTALL) $(topsrcdir)/mozilla/python/virtualenv $(_DEST_DIR)/resources/
rm -rf $(VIRTUALENV_DIR) && \
mkdir $(VIRTUALENV_DIR) && \
unset MACOSX_DEPLOYMENT_TARGET && \
- $(PYTHON) $(_DEST_DIR)/resources/installmozmill.py $(VIRTUALENV_DIR)
+ $(PYTHON) $(_DEST_DIR)/resources/installmozmill.py $(VIRTUALENV_DIR) $(MOZILLA_DIR)/testing/mozbase
libs:: mozmill-virtualenv
PKG_STAGE = $(DIST)/test-stage
stage-package:
$(NSINSTALL) -D $(PKG_STAGE)/mozmill/
@(cd $(topsrcdir)/mail/test/mozmill && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/ && tar -xf -)
--- a/mail/test/resources/installmozmill.py
+++ b/mail/test/resources/installmozmill.py
@@ -42,31 +42,30 @@ def entry_point_path(virtual_env, entry_
### command-line entry point
def main(args=None):
"""command line front-end function"""
# parse command line arguments
args = args or sys.argv[1:]
- usage = "Usage: %prog [destination]"
+ usage = "Usage: %prog destination path/to/mozbase"
# Print the python version
print 'Python: %s' % sys.version
# The data is kept in the same directory as the script
source=os.path.abspath(os.path.dirname(__file__))
# directory to install to
- if not len(args):
- destination = source
- elif len(args) == 1:
+ if len(args) == 2:
destination = os.path.abspath(args[0])
+ mozbase = os.path.abspath(args[1])
else:
- print "Usage: %s [destination]" % sys.argv[0]
+ print "Usage: %s destination path/to/mozbase" % sys.argv[0]
sys.exit(1)
os.chdir(source)
# check for existence of necessary files
if not os.path.exists('virtualenv'):
print "File not found: virtualenv"
sys.exit(1)
@@ -85,10 +84,18 @@ def main(args=None):
print 'Failure to install virtualenv'
sys.exit(returncode)
pip = entry_point_path(destination, 'pip')
returncode = call([pip, 'install'] + [os.path.abspath(package) for package in packages], env=env)
if returncode:
print 'Failure to install packages'
sys.exit(returncode)
+ # Install mozbase packages to the virtualenv
+ mozbase_packages = ['mozfile', 'mozinfo']
+ returncode = call([pip, 'install'] +
+ [os.path.join(mozbase, package) for package in mozbase_packages], env=env)
+ if returncode:
+ print 'Failure to install packages'
+ sys.exit(returncode)
+
if __name__ == '__main__':
main()
--- a/mail/testsuite-targets.mk
+++ b/mail/testsuite-targets.mk
@@ -11,20 +11,20 @@ endif
MOZMILLPYTHON = $(abspath $(VIRTUALENV_BIN)/python$(BIN_SUFFIX))
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
# Mac options
APP_NAME = $(MOZ_APP_DISPLAYNAME)
ifdef MOZ_DEBUG
APP_NAME := $(APP_NAME)Debug
endif
-BINARY = ../../../$(DIST)/$(APP_NAME).app/
+BINARY = ../../$(DIST)/$(APP_NAME).app/
else
# Non-mac options
-BINARY = ../../../$(DIST)/bin/thunderbird$(BIN_SUFFIX)
+BINARY = ../../$(DIST)/bin/thunderbird$(BIN_SUFFIX)
endif
check-no-solo = $(foreach solo,SOLO_TEST SOLO_FILE,$(if $($(solo)),$(error $(subst SOLOVAR,$(solo),$(1)))))
find-solo-test = $(if $(and $(SOLO_TEST),$(SOLO_FILE)),$(error Both SOLO_TEST and SOLO_FILE are specified. You may only specify one.),$(if $(SOLO_TEST),$(SOLO_TEST),$(if $(SOLO_FILE),$(SOLO_FILE),$(error SOLO_TEST or SOLO_FILE needs to be specified.))))
# PYTHONHOME messes very badly with virtualenv setups, so unset it.
mozmill:
$(call check-no-solo,SOLOVAR is specified. Perhaps you meant mozmill-one.)