Bug 1289879 - Activate the mozharness virtualenv when running tests on interactive workers, r=armenzg
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 20 Jul 2016 16:40:40 -0400
changeset 349500 f3d6887279f8175b0d1e3835d1ca2a152bc4453f
parent 349499 52f229a7749e9b4c2c8b59a9f5699038801da001
child 349501 474c03c87e8c80a313be0af14c56049b298027bb
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarmenzg
bugs1289879
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1289879 - Activate the mozharness virtualenv when running tests on interactive workers, r=armenzg There are some packages like 'requests' that are bundled in the mozharness venv, but not in the test package. It would be easy to manually add these to sys.path in the mach bootstrap script, but it's much nicer to simply activate this virtualenv in the first place. MozReview-Commit-ID: 8xeJEIgUbLj
taskcluster/scripts/tester/run-wizard
--- a/taskcluster/scripts/tester/run-wizard
+++ b/taskcluster/scripts/tester/run-wizard
@@ -53,16 +53,23 @@ def setup():
     build_dir = os.path.expanduser(os.path.join('~', 'workspace', 'build'))
     mach_src = os.path.join(build_dir, 'tests', 'mach')
     mach_dest = os.path.expanduser(os.path.join('~', 'bin', 'mach'))
 
     if os.path.exists(mach_dest):
         os.remove(mach_dest)
     os.symlink(mach_src, mach_dest)
 
+    activate = os.path.join(build_dir, 'venv', 'bin', 'activate')
+    if os.path.isfile(activate):
+        # TODO Support other shells
+        bashrc = os.path.expanduser(os.path.join('~', '.bashrc'))
+        with open(bashrc, 'ab') as f:
+            f.write(". {}".format(activate))
+
     print("""
 Mozharness has finished downloading the build and tests to:
 {}
 
 A limited mach environment has also been set up and added to the $PATH, but
 it may be missing the command you need. To see a list of commands, run:
     $ mach help
 """.lstrip().format(build_dir))