Bug 1197224 - Part 2: configure mozharness script to run media tests on Windows; r?jgriffin draft
authorMaja Frydrychowicz <mjzffr@gmail.com>
Thu, 24 Sep 2015 16:35:18 -0400
changeset 296833 a820185652f7982fc9b0409e0cd4663da297894b
parent 296815 031db40e2b558c7e4dd0b4c565db4a992c1627c8
child 509698 54cd11419ef973a22bb23732caa4f9e70c3d9bfd
push id5883
push usermjzffr@gmail.com
push dateMon, 28 Sep 2015 16:48:01 +0000
reviewersjgriffin
bugs1197224, 1198448
milestone44.0a1
Bug 1197224 - Part 2: configure mozharness script to run media tests on Windows; r?jgriffin Correct path for gittool.py in Windows config. Don't install packages in editable mode. Call media tests via Python entry point: similarly to Bug 1198448, calling the firefox-media-tests binary on Windows fails because it triggers a UAC prompt. Instead, we call the same entry-point script via Python.
testing/mozharness/configs/mediatests/buildbot_posix_config.py
testing/mozharness/configs/mediatests/buildbot_windows_config.py
testing/mozharness/mozharness/mozilla/testing/firefox_media_tests.py
--- a/testing/mozharness/configs/mediatests/buildbot_posix_config.py
+++ b/testing/mozharness/configs/mediatests/buildbot_posix_config.py
@@ -36,14 +36,14 @@ config = {
          "https://blobupload.elasticbeanstalk.com",
     ],
     "blob_uploader_auth_file" : os.path.join(os.getcwd(), "oauth.txt"),
     "download_minidump_stackwalk": True,
     "download_symbols": "ondemand",
 
     "firefox_media_repo": 'https://github.com/mjzffr/firefox-media-tests.git',
     "firefox_media_branch": 'master',
-    "firefox_media_rev": '82c45fba24457b5fe447e967bbcaaec5eb14e3ee',
+    "firefox_media_rev": 'b11d6c3d7f6af166be314d2ac6673e78c1edb566',
     "firefox_ui_repo": 'https://github.com/mozilla/firefox-ui-tests.git',
     "firefox_ui_branch": 'master',
     "firefox_ui_rev": '6d6d57917f85399e903ac69b7e4297091b2d474c',
 
 }
--- a/testing/mozharness/configs/mediatests/buildbot_windows_config.py
+++ b/testing/mozharness/configs/mediatests/buildbot_windows_config.py
@@ -12,17 +12,20 @@ config = {
     "virtualenv_path": 'venv',
     "exes": {
         'python': 'c:/mozilla-build/python27/python',
         'virtualenv': ['c:/mozilla-build/python27/python', 'c:/mozilla-build/buildbotve/virtualenv.py'],
         'hg': 'c:/mozilla-build/hg/hg',
         'mozinstall': ['%s/build/venv/scripts/python' % os.getcwd(),
                        '%s/build/venv/scripts/mozinstall-script.py' % os.getcwd()],
         'tooltool.py': [sys.executable, 'C:/mozilla-build/tooltool.py'],
-        'gittool.py': os.path.join(external_tools_path, 'gittool.py'),
+        'gittool.py': [sys.executable,
+                       os.path.join(external_tools_path, 'gittool.py')],
+        'hgtool.py': [sys.executable,
+                      os.path.join(external_tools_path, 'hgtool.py')],
 
 
     },
 
     "find_links": [
         "http://pypi.pvt.build.mozilla.org/pub",
         "http://pypi.pub.build.mozilla.org/pub",
     ],
@@ -44,14 +47,14 @@ config = {
     ],
     "blob_uploader_auth_file" : os.path.join(os.getcwd(), "oauth.txt"),
     "in_tree_config": "config/mozharness/marionette.py",
     "download_minidump_stackwalk": True,
     "download_symbols": "ondemand",
 
     "firefox_media_repo": 'https://github.com/mjzffr/firefox-media-tests.git',
     "firefox_media_branch": 'master',
-    "firefox_media_rev": '82c45fba24457b5fe447e967bbcaaec5eb14e3ee',
+    "firefox_media_rev": 'b11d6c3d7f6af166be314d2ac6673e78c1edb566',
     "firefox_ui_repo": 'https://github.com/mozilla/firefox-ui-tests.git',
     "firefox_ui_branch": 'master',
     "firefox_ui_rev": '6d6d57917f85399e903ac69b7e4297091b2d474c',
 
 }
--- a/testing/mozharness/mozharness/mozilla/testing/firefox_media_tests.py
+++ b/testing/mozharness/mozharness/mozilla/testing/firefox_media_tests.py
@@ -152,25 +152,24 @@ class FirefoxMediaTestsBase(TestingMixin
         self.profile = c.get('profile')
         self.test_timeout = int(c.get('test_timeout'))
         self.tests = c.get('tests')
         self.e10s = c.get('e10s')
 
     @PreScriptAction('create-virtualenv')
     def _pre_create_virtualenv(self, action):
         dirs = self.query_abs_dirs()
-        # cwd is $workspace/build
+        requirements_file = os.path.join(dirs['firefox_media_dir'],
+                                         'requirements.txt')
+        if os.path.isfile(requirements_file):
+            self.register_virtualenv_module(requirements=[requirements_file])
         self.register_virtualenv_module(name='firefox-ui-tests',
-                                        url=dirs['firefox_ui_dir'],
-                                        method='pip',
-                                        editable='true')
+                                        url=dirs['firefox_ui_dir'])
         self.register_virtualenv_module(name='firefox-media-tests',
-                                        url=dirs['firefox_media_dir'],
-                                        method='pip',
-                                        editable='true')
+                                        url=dirs['firefox_media_dir'])
 
     def query_abs_dirs(self):
         if self.abs_dirs:
             return self.abs_dirs
         abs_dirs = super(FirefoxMediaTestsBase, self).query_abs_dirs()
         dirs = {
             'firefox_media_dir': os.path.join(abs_dirs['abs_work_dir'],
                                               'firefox-media-tests')
@@ -204,17 +203,22 @@ class FirefoxMediaTestsBase(TestingMixin
         if revision:
             self.vcs_checkout(vcs='gittool', **self.firefox_ui_vc)
 
     def _query_cmd(self):
         """ Determine how to call firefox-media-tests """
         if not self.binary_path:
             self.fatal("Binary path could not be determined. "
                        "Should be set by default during 'install' action.")
-        cmd = ['firefox-media-tests']
+        dirs = self.query_abs_dirs()
+        venv_python_path = self.query_python_path()
+        runner_script = os.path.join(dirs['firefox_media_dir'],
+                                     'media_test_harness',
+                                     'runtests.py')
+        cmd = [venv_python_path, runner_script]
         cmd += ['--binary', self.binary_path]
         if self.symbols_path:
             cmd += ['--symbols-path', self.symbols_path]
         if self.media_urls:
             cmd += ['--urls', self.media_urls]
         if self.profile:
             cmd += ['--profile', self.profile]
         if self.tests: