Bug 1055926: Add mozinfo packages to the virtualenv for mozmill, r=Standard8 CLOSED TREE
authorJoshua Cranmer <Pidgeot18@gmail.com>
Wed, 20 Aug 2014 00:00:22 -0500
changeset 16678 db0269c8f5d35ee3038b723493a9a6234424ed5d
parent 16677 1b8fb8d0d4daa8ad5f2445e3af262d0078ac3f18
child 16679 8bd04e4b6455b8871ffc5c6605c23e7ea67d2b49
push id10385
push userPidgeot18@gmail.com
push dateSat, 23 Aug 2014 23:02:57 +0000
treeherdercomm-central@db0269c8f5d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1055926
Bug 1055926: Add mozinfo packages to the virtualenv for mozmill, r=Standard8 CLOSED TREE
mail/test/mozmill/Makefile.in
mail/test/resources/installmozmill.py
mail/testsuite-targets.mk
--- 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.)