Bug 787200 - Move the Talos code into mozilla-central: using talos test zip file from mozharness. r=jlund
authorJulien Pagès <j.parkouss@gmail.com>
Wed, 02 Sep 2015 17:36:44 +0200
changeset 294165 fc0471d30643be96eb5d8e49bc3e467057b1e8ea
parent 294164 80c1a6e8dd5c4e933d05f5da5fd8ab8db6329c8c
child 294166 7f87f5ec61e154013210b749119c36e46baa90f4
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlund
bugs787200
milestone43.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 787200 - Move the Talos code into mozilla-central: using talos test zip file from mozharness. r=jlund
testing/mozharness/configs/talos/linux_config.py
testing/mozharness/configs/talos/mac_config.py
testing/mozharness/configs/talos/windows_config.py
testing/mozharness/mozharness/mozilla/testing/talos.py
testing/talos/mach_commands.py
testing/talos/talos.json
--- a/testing/mozharness/configs/talos/linux_config.py
+++ b/testing/mozharness/configs/talos/linux_config.py
@@ -26,24 +26,23 @@ config = {
         'virtualenv': [PYTHON, '/tools/misc-python/virtualenv.py'],
         'tooltool.py': "/tools/tooltool.py",
     },
     "title": os.uname()[1].lower().split('.')[0],
     "default_actions": [
         "clobber",
         "read-buildbot-config",
         "download-and-extract",
-        "clone-talos",
+        "populate-webroot",
         "create-virtualenv",
         "install",
         "run-tests",
     ],
     "python_webserver": False,
     "webroot": '%s/../talos-data' % os.getcwd(),
-    "populate_webroot": True,
     "default_blob_upload_servers": [
         "https://blobupload.elasticbeanstalk.com",
     ],
     "blob_uploader_auth_file": os.path.join(os.getcwd(), "oauth.txt"),
     "download_minidump_stackwalk": True,
     "minidump_stackwalk_path": MINIDUMP_STACKWALK_PATH,
     "minidump_tooltool_manifest_path": TOOLTOOL_MANIFEST_PATH,
     "tooltool_cache": "/builds/tooltool_cache",
--- a/testing/mozharness/configs/talos/mac_config.py
+++ b/testing/mozharness/configs/talos/mac_config.py
@@ -29,24 +29,23 @@ config = {
         'virtualenv': [PYTHON, '/tools/misc-python/virtualenv.py'],
         'tooltool.py': "/tools/tooltool.py",
     },
     "title": os.uname()[1].lower().split('.')[0],
     "default_actions": [
         "clobber",
         "read-buildbot-config",
         "download-and-extract",
-        "clone-talos",
+        "populate-webroot",
         "create-virtualenv",
         "install",
         "run-tests",
     ],
     "python_webserver": False,
     "webroot": '%s/../talos-data' % os.getcwd(),
-    "populate_webroot": True,
     "run_cmd_checks_enabled": True,
     "preflight_run_cmd_suites": [
         SCREEN_RESOLUTION_CHECK,
     ],
     "postflight_run_cmd_suites": [
         SCREEN_RESOLUTION_CHECK,
     ],
     "default_blob_upload_servers": [
--- a/testing/mozharness/configs/talos/windows_config.py
+++ b/testing/mozharness/configs/talos/windows_config.py
@@ -28,24 +28,23 @@ config = {
         'hg': 'c:/mozilla-build/hg/hg',
         'tooltool.py': [PYTHON, 'C:/mozilla-build/tooltool.py'],
     },
     "title": socket.gethostname().split('.')[0],
     "default_actions": [
         "clobber",
         "read-buildbot-config",
         "download-and-extract",
-        "clone-talos",
+        "populate-webroot",
         "create-virtualenv",
         "install",
         "run-tests",
     ],
     "python_webserver": False,
     "webroot": 'c:/slave/talos-data',
-    "populate_webroot": True,
     # Srsly gly? Ys
     "webroot_extract_cmd": r'''c:/mozilla-build/msys/bin/bash -c "PATH=/c/mozilla-build/msys/bin:$PATH tar zx --strip-components=1 -f '%(tarball)s' --wildcards '**/talos/'"''',
     "default_blob_upload_servers": [
         "https://blobupload.elasticbeanstalk.com",
     ],
     "blob_uploader_auth_file": os.path.join(os.getcwd(), "oauth.txt"),
     "metro_harness_path_frmt": "%(metro_base_path)s/metro/metrotestharness.exe",
     "download_minidump_stackwalk": True,
--- a/testing/mozharness/mozharness/mozilla/testing/talos.py
+++ b/testing/mozharness/mozharness/mozilla/testing/talos.py
@@ -146,40 +146,38 @@ class Talos(TestingMixin, MercurialScrip
     ] + talos_config_options + testing_config_options + \
         copy.deepcopy(blobupload_config_options)
 
     def __init__(self, **kwargs):
         kwargs.setdefault('config_options', self.config_options)
         kwargs.setdefault('all_actions', ['clobber',
                                           'read-buildbot-config',
                                           'download-and-extract',
-                                          'clone-talos',
+                                          'populate-webroot',
                                           'create-virtualenv',
                                           'install',
                                           'run-tests',
                                           ])
         kwargs.setdefault('default_actions', ['clobber',
                                               'download-and-extract',
-                                              'clone-talos',
+                                              'populate-webroot',
                                               'create-virtualenv',
                                               'install',
                                               'run-tests',
                                               ])
         kwargs.setdefault('config', {})
         super(Talos, self).__init__(**kwargs)
 
         self.workdir = self.query_abs_dirs()['abs_work_dir']  # convenience
 
         self.run_local = self.config.get('run_local')
         self.installer_url = self.config.get("installer_url")
         self.talos_json_url = self.config.get("talos_json_url")
         self.talos_json = self.config.get("talos_json")
         self.talos_json_config = self.config.get("talos_json_config")
-        self.talos_path = os.path.join(self.workdir, 'talos_repo')
-        self.has_cloned_talos = False
         self.tests = None
         self.pagesets_url = None
         self.pagesets_parent_dir_path = None
         self.pagesets_manifest_path = None
         self.abs_pagesets_paths = None
         self.pagesets_manifest_filename = None
         self.pagesets_manifest_parent_path = None
         self.sps_profile = self.config.get('sps_profile')
@@ -318,35 +316,16 @@ class Talos(TestingMixin, MercurialScrip
         options = []
         c = self.config
         if self.query_talos_json_config():
             options += self.talos_json_config['suites'][c['suite']].get('talos_options', [])
         if c.get('talos_extra_options'):
             options += c['talos_extra_options']
         return options
 
-    def query_talos_repo(self):
-        """Where do we install the talos python package from?
-        This needs to be overrideable by the talos json.
-        """
-        default_repo = "https://hg.mozilla.org/build/talos"
-        if self.query_talos_json_config():
-            return self.talos_json_config.get('global', {}).get('talos_repo', default_repo)
-        else:
-            return self.config.get('talos_repo', default_repo)
-
-    def query_talos_revision(self):
-        """Which talos revision do we want to use?
-        This needs to be overrideable by the talos json.
-        """
-        if self.query_talos_json_config():
-            return self.talos_json_config['global']['talos_revision']
-        else:
-            return self.config.get('talos_revision')
-
     def query_pagesets_url(self):
         """Certain suites require external pagesets to be downloaded and
         extracted.
         """
         if self.pagesets_url:
             return self.pagesets_url
         if self.query_talos_json_config():
             self.pagesets_url = self.talos_json_config['suites'][self.config['suite']].get('pagesets_url')
@@ -449,38 +428,31 @@ class Talos(TestingMixin, MercurialScrip
         return options
 
     def talos_conf_path(self, conf):
         """return the full path for a talos .yml configuration file"""
         if os.path.isabs(conf):
             return conf
         return os.path.join(self.workdir, conf)
 
-    def _populate_webroot(self):
+    def populate_webroot(self):
         """Populate the production test slaves' webroots"""
         c = self.config
-        talos_repo = self.query_talos_repo()
-        talos_revision = self.query_talos_revision()
-        if not c.get('webroot') or not talos_repo:
-            self.fatal("Both webroot and talos_repo need to be set to populate_webroot!")
+        if not c.get('webroot'):
+            self.fatal("webroot need to be set to populate_webroot!")
         self.info("Populating webroot %s..." % c['webroot'])
         talos_webdir = os.path.join(c['webroot'], 'talos')
         self.mkdir_p(c['webroot'], error_level=FATAL)
         self.rmtree(talos_webdir, error_level=FATAL)
 
-        # clone talos' repo
-        repo = {
-            'repo': talos_repo,
-            'vcs': 'hg',
-            'dest': self.talos_path,
-            'revision': talos_revision,
-            'output_timeout': 1200,
-        }
-        self.vcs_checkout(**repo)
-        self.has_cloned_talos = True
+        self.talos_path = os.path.join(
+            self.query_abs_dirs()['abs_work_dir'], 'tests', 'talos'
+        )
+        if c.get('run_local'):
+            self.talos_path = os.path.dirname(self.talos_json)
 
         # the apache server needs the talos directory (talos/talos)
         # to be in the webroot
         src_talos_webdir = os.path.join(self.talos_path, 'talos')
         self.copytree(src_talos_webdir, talos_webdir)
 
         if c.get('use_talos_json'):
             if self.query_pagesets_url():
@@ -506,51 +478,46 @@ class Talos(TestingMixin, MercurialScrip
             if addons_urls:
                 self.info("Downloading addons...")
                 for addons_url in addons_urls:
                     self._download_unzip(addons_url, talos_webdir)
 
     # Action methods. {{{1
     # clobber defined in BaseScript
     # read_buildbot_config defined in BuildbotMixin
-    # download_and_extract defined in TestingMixin
 
-    def clone_talos(self):
-        c = self.config
-        if not c.get('python_webserver', True) and c.get('populate_webroot'):
-            self._populate_webroot()
+    def download_and_extract(self, target_unzip_dirs=None, suite_categories=None):
+        return super(Talos, self).download_and_extract(
+            suite_categories=['common', 'talos']
+        )
 
     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:
-            # require pip >= 1.5 so pip will prefer .whl files to install
-            super(Talos, self).create_virtualenv(
-                modules=['mozinstall', 'pip>=1.5']
-            )
-            # talos in harness requires mozinstall and what is
-            # listed in talos requirements.txt file.
-            self.install_module(
-                requirements=[os.path.join(self.talos_path,
-                                           'requirements.txt')]
-            )
-        else:
-            super(Talos, self).create_virtualenv(**kwargs)
+        # require pip >= 1.5 so pip will prefer .whl files to install
+        super(Talos, self).create_virtualenv(
+            modules=['mozinstall', 'pip>=1.5']
+        )
+        # talos in harness requires mozinstall and what is
+        # listed in talos requirements.txt file.
+        self.install_module(
+            requirements=[os.path.join(self.talos_path,
+                                       'requirements.txt')]
+        )
 
     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.
         """
         c = self.config
-        if not c.get('python_webserver', True) and c.get('populate_webroot') \
-                and self.query_pagesets_url():
+        if not c.get('python_webserver', True) and self.query_pagesets_url():
             pagesets_path = self.query_pagesets_manifest_path()
             manifest_source = os.path.join(c['webroot'], pagesets_path)
             manifest_target = os.path.join(self.query_python_site_packages_path(), pagesets_path)
             self.mkdir_p(os.path.dirname(manifest_target))
             self.copyfile(manifest_source, manifest_target)
 
     def preflight_run_tests(self):
         if not self.query_tests():
--- a/testing/talos/mach_commands.py
+++ b/testing/talos/mach_commands.py
@@ -69,22 +69,21 @@ class TalosRunner(MozbuildObject):
             'use_talos_json': True,
             'base_work_dir': self.mozharness_dir,
             'exes': {
                 'python': self.python_interp,
                 'virtualenv': [self.python_interp, self.virtualenv_script]
             },
             'title': socket.gethostname(),
             'default_actions': [
-                'clone-talos',
+                'populate-webroot',
                 'create-virtualenv',
                 'run-tests',
             ],
             'python_webserver': False,
-            'populate_webroot': True,
             'talos_extra_options': ['--develop'],
         }
 
     def make_args(self):
         self.args = {
             'config': {
                 'suite': self.suite,
                 'sps_profile': self.sps_profile,
--- a/testing/talos/talos.json
+++ b/testing/talos/talos.json
@@ -1,17 +1,13 @@
 {
     "talos.zip": {
         "url": "http://talos-bundles.pvt.build.mozilla.org/zips/talos.a6052c33d420.zip",
         "path": ""
     },
-    "global": {
-        "talos_repo": "https://hg.mozilla.org/build/talos",
-        "talos_revision": "3b94adbd66f1"
-    },
     "extra_options": {
         "android": [ "--apkPath=%(apk_path)s" ]
     },
     "suites": {
         "chromez": {
             "tests": ["tresize", "tcanvasmark"]
         },
         "chromez-e10s": {