Bug 1467827 - Port raptor firefox tp6 to linux (wip) draft
authorRob Wood <rwood@mozilla.com>
Wed, 13 Jun 2018 14:04:46 -0700
changeset 808164 ea89e3abf457564d1dbbc5b27c98cd44d06df0df
parent 808144 1d03f4a4af28c1af56a183f5951a45a315a6c788
push id113298
push userrwood@mozilla.com
push dateMon, 18 Jun 2018 15:56:25 +0000
bugs1467827
milestone62.0a1
Bug 1467827 - Port raptor firefox tp6 to linux (wip) MozReview-Commit-ID: 1OSwaxYoUgT
taskcluster/taskgraph/transforms/tests.py
testing/mozharness/configs/raptor/linux_config.py
testing/raptor/raptor/playback/mitmproxy-rel-bin-linux64.manifest
testing/raptor/raptor/playback/mitmproxy.py
testing/raptor/raptor/raptor.py
testing/raptor/raptor/tests/raptor-tp6.ini
--- a/taskcluster/taskgraph/transforms/tests.py
+++ b/taskcluster/taskgraph/transforms/tests.py
@@ -403,17 +403,18 @@ def set_defaults(config, tests):
             # platform phyla
             test['loopback-video'] = True
         else:
             # all non-android tests want to run the bits that require node
             test['mozharness']['set-moz-node-path'] = True
             test.setdefault('e10s', True)
 
         # software-gl-layers is only meaningful on linux unittests, where it defaults to True
-        if test['test-platform'].startswith('linux') and test['suite'] != 'talos':
+        if test['test-platform'].startswith('linux') and test['suite'] != 'talos' and \
+                test['suite'] != 'raptor':
             test.setdefault('allow-software-gl-layers', True)
         else:
             test['allow-software-gl-layers'] = False
 
         # Enable WebRender by default on the QuantumRender test platforms, since
         # the whole point of QuantumRender is to run with WebRender enabled.
         # This currently matches linux64-qr and windows10-64-qr; both of these
         # have /opt and /debug variants.
--- a/testing/mozharness/configs/raptor/linux_config.py
+++ b/testing/mozharness/configs/raptor/linux_config.py
@@ -9,27 +9,27 @@ else:
     TOOLTOOL_MANIFEST_PATH = "config/tooltool-manifests/linux32/releng.manifest"
     MINIDUMP_STACKWALK_PATH = "linux32-minidump_stackwalk"
 
 config = {
     "log_name": "raptor",
     "installer_path": "installer.exe",
     "virtualenv_path": VENV_PATH,
     "find_links": [
-        "http://pypi.pvt.build.mozilla.org/pub",
-        "http://pypi.pub.build.mozilla.org/pub",
+        "https://pypi.pvt.build.mozilla.org/pub",
+        "https://pypi.pub.build.mozilla.org/pub",
     ],
     "pip_index": False,
     "title": os.uname()[1].lower().split('.')[0],
     "default_actions": [
         "clobber",
         "download-and-extract",
         "populate-webroot",
+        "install-chrome",
         "create-virtualenv",
         "install",
-        "setup-mitmproxy",
         "run-tests",
     ],
     "download_minidump_stackwalk": True,
     "minidump_stackwalk_path": MINIDUMP_STACKWALK_PATH,
     "minidump_tooltool_manifest_path": TOOLTOOL_MANIFEST_PATH,
     "tooltool_cache": "/builds/tooltool_cache",
 }
new file mode 100644
--- /dev/null
+++ b/testing/raptor/raptor/playback/mitmproxy-rel-bin-linux64.manifest
@@ -0,0 +1,9 @@
+[
+    {
+        "filename": "mitmproxy-2.0.2-linux.tar.gz",
+        "size": 48997542,
+        "digest": "b032e04b8763206a19f80b78062efa59dc901ad32fd8d6cf2d20e22744711352da61e75d93a0d93d645179153534f72a154f73432837db415c9b0cd9d981f012",
+        "algorithm": "sha512",
+        "unpack": true
+    }
+]
--- a/testing/raptor/raptor/playback/mitmproxy.py
+++ b/testing/raptor/raptor/playback/mitmproxy.py
@@ -112,22 +112,37 @@ class Mitmproxy(Playback):
 
     def download(self):
         # download mitmproxy binary and pageset using tooltool
         # note: tooltool automatically unpacks the files as well
         if not os.path.exists(self.raptor_dir):
             os.makedirs(self.raptor_dir)
         LOG.info("downloading mitmproxy binary")
         _manifest = os.path.join(here, self.config['playback_binary_manifest'])
-        self._tooltool_fetch(_manifest)
+        transformed_manifest = self.transform_platform(_manifest)
+        self._tooltool_fetch(transformed_manifest)
         LOG.info("downloading mitmproxy pageset")
         _manifest = os.path.join(here, self.config['playback_pageset_manifest'])
-        self._tooltool_fetch(_manifest)
+        transformed_manifest = self.transform_platform(_manifest)
+        self._tooltool_fetch(transformed_manifest)
         return
 
+    def transform_platform(self, str_to_transform):
+        # transform platform name i.e. 'mitmproxy-rel-bin-{platform}.manifest'
+        # transforms to 'mitmproxy-rel-bin-osx.manifest'
+        if '{platform}' not in str_to_transform:
+            return str_to_transform
+        if 'win' in self.config['platform']:
+            platform_id = 'win'
+        elif self.config['platform'] == 'mac':
+            platform_id = 'osx'
+        else:
+            platform_id = 'linux64'
+        return str_to_transform.replace('{platform}', platform_id)
+
     def setup(self):
         # install the generated CA certificate into Firefox
         # mitmproxy cert setup needs path to mozharness install; mozharness has set this
         # value in the SCRIPTSPATH env var for us in mozharness/mozilla/testing/talos.py
         scripts_path = os.environ.get('SCRIPTSPATH')
         LOG.info('scripts_path: %s' % str(scripts_path))
         self.install_mitmproxy_cert(self.mitmproxy_proc,
                                     self.browser_path,
--- a/testing/raptor/raptor/raptor.py
+++ b/testing/raptor/raptor/raptor.py
@@ -71,16 +71,18 @@ class Raptor(object):
         self.output_handler = OutputHandler()
         process_args = {
             'processOutputLine': [self.output_handler],
         }
         runner_cls = runners[app]
         self.runner = runner_cls(
             binary, profile=self.profile, process_args=process_args)
 
+        self.log.info("raptor config: %s" % str(self.config))
+
     @property
     def profile_data_dir(self):
         if 'MOZ_DEVELOPER_REPO_DIR' in os.environ:
             return os.path.join(os.environ['MOZ_DEVELOPER_REPO_DIR'], 'testing', 'profiles')
         if build:
             return os.path.join(build.topsrcdir, 'testing', 'profiles')
         return os.path.join(here, 'profile_data')
 
--- a/testing/raptor/raptor/tests/raptor-tp6.ini
+++ b/testing/raptor/raptor/tests/raptor-tp6.ini
@@ -2,18 +2,18 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # raptor tp6
 
 [DEFAULT]
 type =  pageload
 playback = mitmproxy
-playback_binary_manifest = mitmproxy-rel-bin-osx.manifest
-playback_binary_zip_mac = mitmproxy-2.0.2-osx.tar.gz
+playback_binary_manifest = mitmproxy-rel-bin-{platform}.manifest
+playback_binary_zip_mac = mitmproxy-2.0.2-{platform}.tar.gz
 playback_pageset_manifest = mitmproxy-playback-set.manifest
 playback_pageset_zip_mac = mitmproxy-recording-set-win10.zip
 page_cycles = 25
 unit = ms
 lower_is_better = true
 alert_threshold = 2.0
 
 [raptor-firefox-tp6-amazon]