Bug 1516843 - Install mozmill packages in build virtualenv (for local development only); r=Fallen
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 01 Jan 2019 11:22:36 +1300
changeset 33239 a58e59146246
parent 33238 178da49fe8c8
child 33240 c65545fc8877
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFallen
bugs1516843
Bug 1516843 - Install mozmill packages in build virtualenv (for local development only); r=Fallen
calendar/test/mozmill/Makefile.in
mail/test/mozmill/Makefile.in
mail/test/mozmill/moz.build
mail/test/resources/installmozmill.py
mail/testsuite-targets.mk
--- a/calendar/test/mozmill/Makefile.in
+++ b/calendar/test/mozmill/Makefile.in
@@ -1,17 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-MOZMILLDIR=$(DEPTH)/_tests/mozmill
+MOZMILLDIR=$(topobjdir)/_tests/mozmill
 ifeq ($(OS_ARCH),WINNT)
-VIRTUALENV_BIN = $(MOZMILLDIR)/../mozmill-virtualenv/Scripts
+VIRTUALENV_BIN = $(topobjdir)/_virtualenvs/init/Scripts
 else
-VIRTUALENV_BIN = $(MOZMILLDIR)/../mozmill-virtualenv/bin
+VIRTUALENV_BIN = $(topobjdir)/_virtualenvs/init/bin
 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
--- a/mail/test/mozmill/Makefile.in
+++ b/mail/test/mozmill/Makefile.in
@@ -10,20 +10,18 @@ include $(moztopsrcdir)/config/rules.mk
 
 $(_DEST_DIR):
 	$(NSINSTALL) -D $@
 
 
 # Copy MozMill and its dependencies over, and set up a virtualenv. The
 # virtualenv directory is outside because we don't want to bundle it up during
 # stage-package.
-VIRTUALENV_DIR = $(_DEST_DIR)/../mozmill-virtualenv
+VIRTUALENV_DIR = $(topobjdir)/_virtualenvs/init
 mozmill-virtualenv: $(_DEST_DIR)
-	rm -rf $(VIRTUALENV_DIR) && \
-	mkdir $(VIRTUALENV_DIR) && \
 	unset MACOSX_DEPLOYMENT_TARGET && \
 	$(PYTHON) $(_DEST_DIR)/resources/installmozmill.py $(VIRTUALENV_DIR)
 
 ifndef MOZ_AUTOMATION
 # We don't run mozmill tests as part of the build in automation, so skip
 # creating a virtualenv for them.
 libs:: mozmill-virtualenv
 endif
--- a/mail/test/mozmill/moz.build
+++ b/mail/test/mozmill/moz.build
@@ -6,24 +6,18 @@
 TEST_HARNESS_FILES.mozmill += [
     'mozmilltests.list',
     'runtest.py',
     'runtestlist.py',
 ]
 
 TEST_HARNESS_FILES.mozmill.resources += [
     '/{}/mail/base/test/unit/resources/viewWrapperTestUtils.js'.format(CONFIG['commreltopsrcdir']),
-]
-
-TEST_HARNESS_FILES.mozmill.resources += [
     '/{}/mail/test/resources/*'.format(CONFIG['commreltopsrcdir']),
 ]
-TEST_HARNESS_FILES.mozmill.resources.virtualenv += [
-    '/{}/third_party/python/virtualenv/*'.format(CONFIG['mozreltopsrcdir']),
-]
 
 
 def mailnews_files(files, comm=CONFIG['commreltopsrcdir']):
     return [
         '/{comm}/mailnews/{file}'.format(
             comm=comm,
             file=file,
         ) for file in files
--- a/mail/test/resources/installmozmill.py
+++ b/mail/test/resources/installmozmill.py
@@ -71,37 +71,22 @@ def main(args=None):
 
     topsrcdir = buildconfig.substs['top_srcdir']
 
     mozbase = os.path.join(topsrcdir, "testing/mozbase")
     mozpython = os.path.join(topsrcdir, "python")
 
     os.chdir(source)
 
-    # check for existence of necessary files
-    if not os.path.exists('virtualenv'):
-        print "File not found: virtualenv"
-        sys.exit(1)
-
     # packages to install in dependency order
     packages = ["jsbridge", "mozmill"]
 
     # create the virtualenv and install packages
     env = os.environ.copy()
     env.pop('PYTHONHOME', None)
-    returncode = call([sys.executable, os.path.join('virtualenv', 'virtualenv.py'),
-                       # Without this, virtualenv.py may attempt to contact the outside
-                       # world and search for or download a newer version of pip,
-                       # setuptools, or wheel. This is bad for security, reproducibility,
-                       # and speed.
-                       "--no-download",
-                       destination], env=env)
-    if returncode:
-        print 'Failure to install virtualenv'
-        sys.exit(returncode)
     pip = entry_point_path(destination, 'pip')
 
     # Install packages to the virtualenv
     mozbase_packages = [
         'manifestparser', 'mozfile', 'mozinfo', 'mozlog', 'mozprofile',
         'mozcrash', 'moznetwork', 'mozprocess', 'mozdevice', 'mozrunner',
     ]
     python_packages = ['mozterm']
--- a/mail/testsuite-targets.mk
+++ b/mail/testsuite-targets.mk
@@ -1,17 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-MOZMILLDIR=$(DEPTH)/_tests/mozmill
+MOZMILLDIR=$(topobjdir)/_tests/mozmill
 ifeq ($(OS_ARCH),WINNT)
-VIRTUALENV_BIN = $(MOZMILLDIR)/../mozmill-virtualenv/Scripts
+VIRTUALENV_BIN = $(topobjdir)/_virtualenvs/init/Scripts
 else
-VIRTUALENV_BIN = $(MOZMILLDIR)/../mozmill-virtualenv/bin
+VIRTUALENV_BIN = $(topobjdir)/_virtualenvs/init/bin
 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