Bug 1185539 - './mach talos-test tp5o' doesn't run (checked in version, not bugzilla version). a=test-only
authorJoel Maher <jmaher@mozilla.com>
Tue, 04 Aug 2015 11:51:30 -0400
changeset 281792 c4205c07ec41f92538e170b9d1172c2628a348fa
parent 281791 981ee28f54e4a4df7d90097367eff8e17d5c5e3d
child 281793 22aa1839003cbf0d0fd27edc07511de988d8d45f
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs1185539
milestone41.0a2
Bug 1185539 - './mach talos-test tp5o' doesn't run (checked in version, not bugzilla version). a=test-only
testing/mozharness/mozharness/mozilla/testing/talos.py
--- a/testing/mozharness/mozharness/mozilla/testing/talos.py
+++ b/testing/mozharness/mozharness/mozilla/testing/talos.py
@@ -517,36 +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')]
             )
-            virtualenv_modules = []
-            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.
@@ -576,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,