diff --git a/testing/mochitest/moz.build b/testing/mochitest/moz.build index 65fb26541236..fcb0ca9f35fb 100644 --- a/testing/mochitest/moz.build +++ b/testing/mochitest/moz.build @@ -160,5 +160,6 @@ TEST_HARNESS_FILES.testing.mochitest.iceserver += [ TEST_HARNESS_FILES.testing.mochitest.websocketprocessbridge += [ '/testing/tools/websocketprocessbridge/websocketprocessbridge.py', + '/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements.txt', ] diff --git a/testing/mozharness/scripts/android_emulator_unittest.py b/testing/mozharness/scripts/android_emulator_unittest.py index 356e75ebf9ee..a0b8671550cf 100644 --- a/testing/mozharness/scripts/android_emulator_unittest.py +++ b/testing/mozharness/scripts/android_emulator_unittest.py @@ -22,7 +22,7 @@ sys.path.insert(1, os.path.dirname(sys.path[0])) from mozprocess import ProcessHandler from mozharness.base.log import FATAL -from mozharness.base.script import BaseScript +from mozharness.base.script import BaseScript, PreScriptAction from mozharness.base.vcs.vcsbase import VCSMixin from mozharness.mozilla.blob_upload import BlobUploadMixin, blobupload_config_options from mozharness.mozilla.mozbase import MozbaseMixin @@ -136,6 +136,8 @@ class AndroidEmulatorTest(BlobUploadMixin, TestingMixin, EmulatorMixin, VCSMixin abs_dirs['abs_work_dir'], 'blobber_upload_dir') dirs['abs_emulator_dir'] = os.path.join( abs_dirs['abs_work_dir'], 'emulator') + dirs['abs_mochitest_dir'] = os.path.join( + dirs['abs_test_install_dir'], 'mochitest') if self.config.get("developer_mode"): dirs['abs_avds_dir'] = os.path.join( @@ -149,6 +151,19 @@ class AndroidEmulatorTest(BlobUploadMixin, TestingMixin, EmulatorMixin, VCSMixin self.abs_dirs = abs_dirs return self.abs_dirs + @PreScriptAction('create-virtualenv') + def _pre_create_virtualenv(self, action): + dirs = self.query_abs_dirs() + + if os.path.isdir(dirs['abs_mochitest_dir']): + # mochitest is the only thing that needs this + requirements = os.path.join(dirs['abs_mochitest_dir'], + 'websocketprocessbridge', + 'websocketprocessbridge_requirements.txt') + + self.register_virtualenv_module(requirements=[requirements], + two_pass=True) + def _launch_emulator(self): env = self.query_env() diff --git a/testing/mozharness/scripts/androidx86_emulator_unittest.py b/testing/mozharness/scripts/androidx86_emulator_unittest.py index 41fbd26d97b7..1d1c96df9d99 100644 --- a/testing/mozharness/scripts/androidx86_emulator_unittest.py +++ b/testing/mozharness/scripts/androidx86_emulator_unittest.py @@ -21,7 +21,7 @@ sys.path.insert(1, os.path.dirname(sys.path[0])) from mozprocess import ProcessHandler from mozharness.base.log import FATAL -from mozharness.base.script import BaseScript, PostScriptRun +from mozharness.base.script import BaseScript, PostScriptRun, PreScriptAction from mozharness.base.vcs.vcsbase import VCSMixin from mozharness.mozilla.blob_upload import BlobUploadMixin, blobupload_config_options from mozharness.mozilla.mozbase import MozbaseMixin @@ -143,6 +143,8 @@ class AndroidEmulatorTest(BlobUploadMixin, TestingMixin, EmulatorMixin, VCSMixin abs_dirs['abs_work_dir'], 'blobber_upload_dir') dirs['abs_emulator_dir'] = os.path.join( abs_dirs['abs_work_dir'], 'emulator') + dirs['abs_mochitest_dir'] = os.path.join( + dirs['abs_test_install_dir'], 'mochitest') if self.config.get("developer_mode"): dirs['abs_avds_dir'] = os.path.join( @@ -156,6 +158,19 @@ class AndroidEmulatorTest(BlobUploadMixin, TestingMixin, EmulatorMixin, VCSMixin self.abs_dirs = abs_dirs return self.abs_dirs + @PreScriptAction('create-virtualenv') + def _pre_create_virtualenv(self, action): + dirs = self.query_abs_dirs() + + if os.path.isdir(dirs['abs_mochitest_dir']): + # mochitest is the only thing that needs this + requirements = os.path.join(dirs['abs_mochitest_dir'], + 'websocketprocessbridge', + 'websocketprocessbridge_requirements.txt') + + self.register_virtualenv_module(requirements=[requirements], + two_pass=True) + def _build_arg(self, option, value): """ Build a command line argument diff --git a/testing/mozharness/scripts/desktop_unittest.py b/testing/mozharness/scripts/desktop_unittest.py index d8eb1c7c1ce8..d28d335343d5 100755 --- a/testing/mozharness/scripts/desktop_unittest.py +++ b/testing/mozharness/scripts/desktop_unittest.py @@ -260,11 +260,20 @@ class DesktopUnittest(TestingMixin, MercurialScript, BlobUploadMixin, MozbaseMix self.register_virtualenv_module(name='mock') self.register_virtualenv_module(name='simplejson') - requirements = os.path.join(dirs['abs_test_install_dir'], - 'config', - 'marionette_requirements.txt') - if os.path.isfile(requirements): - self.register_virtualenv_module(requirements=[requirements], + requirements_files = [ + os.path.join(dirs['abs_test_install_dir'], + 'config', + 'marionette_requirements.txt')] + + if os.path.isdir(dirs['abs_mochitest_dir']): + # mochitest is the only thing that needs this + requirements_files.append( + os.path.join(dirs['abs_mochitest_dir'], + 'websocketprocessbridge', + 'websocketprocessbridge_requirements.txt')) + + for requirements_file in requirements_files: + self.register_virtualenv_module(requirements=[requirements_file], two_pass=True) def _query_symbols_url(self): diff --git a/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements.txt b/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements.txt new file mode 100644 index 000000000000..51e54809461e --- /dev/null +++ b/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements.txt @@ -0,0 +1,13 @@ +twisted==10.2.0 + +# websocket adapter for twisted, might be built into twisted someday +txws==0.9.1 + +psutil==3.1.1 + +# needed by txws, but pypi doesn't know about it +six==1.10.0 + +# Needed by iceserver +ipaddr==2.1.11 +passlib==1.6.5