Bug 1189021 - talos is not seen as a package when used by mozharness. r=jmaher
authorJulien Pagès <j.parkouss@gmail.com>
Mon, 03 Aug 2015 17:17:32 +0200
changeset 287639 887432a3049f36070e6518157c70f6d2008c4963
parent 287638 69f2a0f7b8ad400e807a2c57424585c2b4ff9d31
child 287640 b8d147ca6d04a342f9971b8b22298622d04dd12f
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1189021
milestone42.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 1189021 - talos is not seen as a package when used by mozharness. r=jmaher
testing/mozharness/mozharness/mozilla/testing/talos.py
--- a/testing/mozharness/mozharness/mozilla/testing/talos.py
+++ b/testing/mozharness/mozharness/mozilla/testing/talos.py
@@ -517,37 +517,23 @@ class Talos(TestingMixin, MercurialScrip
             self._populate_webroot()
 
     def create_virtualenv(self, **kwargs):
         """VirtualenvMixin.create_virtualenv() assuemes we're using
         self.config['virtualenv_modules']. Since we are installing
         talos from its source, we have to wrap that method here."""
         # XXX This method could likely be replaced with a PreScriptAction hook.
         if self.has_cloned_talos:
-            requirements = self.read_from_file(
-                os.path.join(self.talos_path, 'requirements.txt'),
-                verbose=False
+            # talos in harness requires mozinstall and what is
+            # listed in talos requirements.txt file.
+            return super(Talos, self).create_virtualenv(
+                modules=['mozinstall'],
+                requirements=[os.path.join(self.talos_path,
+                                           'requirements.txt')]
             )
-            # talos in harness requires mozinstall
-            virtualenv_modules = ['mozinstall']
-            for requirement in requirements.splitlines():
-                requirement = requirement.strip()
-                if requirement:
-                    virtualenv_modules.append(requirement)
-
-            # Bug 900015 - Silent warnings on osx when libyaml is not found
-            pyyaml_module = {
-                'name': 'PyYAML',
-                'url': None,
-                'global_options': ['--without-libyaml']
-            }
-            virtualenv_modules.insert(0, pyyaml_module)
-
-            self.info(pprint.pformat(virtualenv_modules))
-            return super(Talos, self).create_virtualenv(modules=virtualenv_modules)
         else:
             return super(Talos, self).create_virtualenv(**kwargs)
 
     def postflight_create_virtualenv(self):
         """ This belongs in download_and_install() but requires the
         virtualenv to be set up :(
 
         The real fix here may be a --tpmanifest option for PerfConfigurator.
@@ -577,16 +563,22 @@ class Talos(TestingMixin, MercurialScrip
         parser = TalosOutputParser(config=self.config, log_obj=self.log_obj,
                                    error_list=TalosErrorList)
         env = {}
         env['MOZ_UPLOAD_DIR'] = self.query_abs_dirs()['abs_blob_upload_dir']
         env['MINIDUMP_SAVE_PATH'] = self.query_abs_dirs()['abs_blob_upload_dir']
         if not os.path.isdir(env['MOZ_UPLOAD_DIR']):
             self.mkdir_p(env['MOZ_UPLOAD_DIR'])
         env = self.query_env(partial_env=env, log_level=INFO)
+        # adjust PYTHONPATH to be able to use talos as a python package
+        if 'PYTHONPATH' in env:
+            env['PYTHONPATH'] = self.talos_path + os.pathsep + env['PYTHONPATH']
+        else:
+            env['PYTHONPATH'] = self.talos_path
+
         # sets a timeout for how long talos should run without output
         output_timeout = self.config.get('talos_output_timeout', 3600)
         # run talos tests
         run_tests = os.path.join(self.talos_path, 'talos', 'run_tests.py')
         command = [python, run_tests, '--debug'] + options
         self.return_code = self.run_command(command, cwd=self.workdir,
                                             output_timeout=output_timeout,
                                             output_parser=parser,