Bug 1154796 - Sync in-tree copy of mozharness to hgmo mozharness 4a31e6739409. r=ryanvm, a=test-only
authorJordan Lund <jlund@mozilla.com>
Thu, 09 Jul 2015 09:53:03 -0700
changeset 281434 7b18c0ff979a8c9f3cfe6c73068cca495790a3f4
parent 281433 f89d2e9d776a6b14a0eaee103001a87a348213b3
child 281435 113007b56abf92a7ce6a2950e205530df73b029b
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)
reviewersryanvm, test-only
bugs1154796
milestone41.0a2
Bug 1154796 - Sync in-tree copy of mozharness to hgmo mozharness 4a31e6739409. r=ryanvm, a=test-only CLOSED TREE
testing/mozharness/configs/luciddream/linux_config.py
testing/mozharness/configs/vcs_sync/beagle.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
testing/mozharness/scripts/firefox_ui_updates.py
testing/mozharness/scripts/luciddream_unittest.py
--- a/testing/mozharness/configs/luciddream/linux_config.py
+++ b/testing/mozharness/configs/luciddream/linux_config.py
@@ -24,16 +24,18 @@ config = {
     },
 
     "find_links": [
         "http://pypi.pvt.build.mozilla.org/pub",
         "http://pypi.pub.build.mozilla.org/pub",
     ],
     "pip_index": False,
 
+    "in_tree_config": "config/mozharness/linux_config.py",
+
     "buildbot_json_path": "buildprops.json",
 
     "default_blob_upload_servers": [
         "https://blobupload.elasticbeanstalk.com",
     ],
     "blob_uploader_auth_file": os.path.join(os.getcwd(), "oauth.txt"),
     # will handle in-tree config as subsequent patch
     # "in_tree_config": "config/mozharness/luciddream.py",
--- a/testing/mozharness/configs/vcs_sync/beagle.py
+++ b/testing/mozharness/configs/vcs_sync/beagle.py
@@ -298,16 +298,44 @@ config = {
                 "^B2G_",
             ],
         },
         "mapper": {
             "url": "https://api.pub.build.mozilla.org/mapper",
             "project": "gecko-dev"
         },
     }, {
+        "repo": "https://hg.mozilla.org/releases/mozilla-b2g37_v2_2r",
+        "revision": "default",
+        "repo_name": "mozilla-b2g37_v2_2r",
+        "targets": [{
+            "target_dest": "beagle/.git",
+            "vcs": "git",
+            "test_push": True,
+        }, {
+            "target_dest": "gitmo-beagle",
+        }, {
+            "target_dest": "github-beagle",
+        }],
+        "vcs": "hg",
+        "branch_config": {
+            "branches": {
+                "default": "b2g37_v2_2r",
+            },
+        },
+        "tag_config": {
+            "tag_regexes": [
+                "^B2G_",
+            ],
+        },
+        "mapper": {
+            "url": "https://api.pub.build.mozilla.org/mapper",
+            "project": "gecko-dev"
+        },
+    }, {
         "repo": "https://hg.mozilla.org/releases/mozilla-b2g32_v2_0",
         "revision": "default",
         "repo_name": "mozilla-b2g32_v2_0",
         "targets": [{
             "target_dest": "beagle/.git",
             "vcs": "git",
             "test_push": True,
         }, {
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -1049,17 +1049,16 @@ or run without that action (ie: --no-{ac
                                              c.get('src_mozconfig'))
             if not os.path.exists(abs_src_mozconfig):
                 self.info('abs_src_mozconfig: %s' % (abs_src_mozconfig,))
                 self.fatal(ERROR_MSGS['src_mozconfig_path_not_found'])
             self.copyfile(abs_src_mozconfig,
                           os.path.join(dirs['abs_src_dir'], '.mozconfig'))
             self.info("mozconfig content:")
             with open(abs_src_mozconfig) as mozconfig:
-                next(mozconfig)
                 for line in mozconfig:
                     self.info(line)
         else:
             self.fatal("To build, you must supply a mozconfig from inside the "
                        "tree to use use. Please provide the path in your "
                        "config via 'src_mozconfig'")
 
     # TODO: replace with ToolToolMixin
--- a/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
+++ b/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
@@ -13,45 +13,58 @@ import sys
 import os
 
 from mozharness.base.python import (
     PreScriptAction,
     VirtualenvMixin,
     virtualenv_config_options,
 )
 from mozharness.mozilla.vcstools import VCSToolsScript
+from mozharness.mozilla.purge import PurgeMixin
 
 
-class FirefoxUITests(VCSToolsScript, VirtualenvMixin):
+class FirefoxUITests(VCSToolsScript, VirtualenvMixin, PurgeMixin):
     config_options = [
         [['--firefox-ui-repo'], {
             'dest': 'firefox_ui_repo',
             'default': 'https://github.com/mozilla/firefox-ui-tests.git',
             'help': 'which firefox_ui_tests repo to use',
         }],
         [['--firefox-ui-branch'], {
             'dest': 'firefox_ui_branch',
             'help': 'which branch to use for firefox_ui_tests',
         }],
     ] + copy.deepcopy(virtualenv_config_options)
 
-    def __init__(self, config_options=[], all_actions=[], **kwargs):
+    def __init__(self,
+                 config={},
+                 config_options=[],
+                 all_actions=[],
+                 **kwargs):
+        default_config = {
+            'purge_minsize': 2,
+        }
+        default_config.update(config)
+
         self.config_options += config_options
 
         if all_actions is None:
             # Default actions
             all_actions = [
+                'purge-builds',
                 'clobber',
                 'checkout',
                 'create-virtualenv',
                 'run-tests',
             ]
 
         super(FirefoxUITests, self).__init__(
             config_options=self.config_options,
+            require_config_file=True,
+            config=default_config,
             all_actions=all_actions,
             **kwargs
         )
 
         self.firefox_ui_repo = self.config['firefox_ui_repo']
 
         if 'checkout' in self.actions:
             try:
--- a/testing/mozharness/scripts/firefox_ui_updates.py
+++ b/testing/mozharness/scripts/firefox_ui_updates.py
@@ -87,16 +87,17 @@ class FirefoxUIUpdates(FirefoxUITests):
                 'dest': 'installer_path',
                 'help': 'Point to an installer to test against.',
             }],
         ] + copy.deepcopy(self.harness_extra_args)
 
         super(FirefoxUIUpdates, self).__init__(
             config_options=config_options,
             all_actions=[
+                'purge-builds',
                 'clobber',
                 'checkout',
                 'create-virtualenv',
                 'determine-testing-configuration',
                 'run-tests',
             ],
         )
 
--- a/testing/mozharness/scripts/luciddream_unittest.py
+++ b/testing/mozharness/scripts/luciddream_unittest.py
@@ -223,36 +223,42 @@ class LuciddreamTest(TestingMixin, Mercu
         ld_dir = os.path.join(dirs['abs_test_install_dir'], 'luciddream')
 
         if self.config.get('b2gdesktop_path') or self.config.get('b2gdesktop_url'):
             self.setup_gaia()
 
         ld_parser = self.parser_class(config=self.config,
                                       log_obj=self.log_obj,
                                       error_list=BaseErrorList)
-
-        raw_log = os.path.join(dirs['abs_work_dir'], 'luciddream_raw.log')
+ 
         cmd = [self.query_python_path('python'),
-               os.path.join(ld_dir, 'luciddream', 'runluciddream.py'),
-               '--log-raw=%s' % raw_log
+               os.path.join(ld_dir, 'luciddream', 'runluciddream.py')
                ]
+
+        str_format_values = {
+            'browser_path': self.binary_path,
+            'raw_log_file': os.path.join(dirs['abs_work_dir'], 'luciddream_raw.log'),
+            'test_manifest': os.path.join(ld_dir, 'example-tests', 'luciddream.ini')
+        }
+
         if self.config.get('emulator_url'):
-            cmd += ['--b2gpath', dirs['abs_b2g-distro_dir'],
-                    '--browser-path', self.binary_path,
-                    ]
+            str_format_values['emulator_path'] = dirs['abs_b2g-distro_dir']
         else:
             if self.config.get('b2gdesktop_url'):
-                bin_path = os.path.join(dirs['abs_b2g_desktop'], 'b2g', 'b2g')
+                str_format_values['fxos_desktop_path'] = os.path.join(dirs['abs_b2g_desktop'], 'b2g', 'b2g')
             else:
-                bin_path = self.config.get('b2gdesktop_path')
-            cmd += ['--b2g-desktop-path', bin_path,
-                    '--browser-path', self.binary_path,
-                    '--gaia-profile', os.path.join(dirs['abs_gaia_dir'], 'profile'),
-                    ]
-        cmd += [os.path.join(ld_dir, 'example-tests', 'luciddream.ini')]
+                str_format_values['fxos_desktop_path'] = self.config.get('b2gdesktop_path')
+            str_format_values['gaia_profile'] = os.path.join(dirs['abs_gaia_dir'], 'profile')
+
+        suite = 'luciddream-emulator' if self.config.get('emulator_url') else 'luciddream-b2gdt'
+        options = self.tree_config['suite_definitions'][suite]['options']
+        for option in options:
+            option = option % str_format_values
+            if not option.endswith('None'):
+                cmd.append(option)
 
         code = self.run_command(cmd, env=env,
                                 output_timeout=1000,
                                 output_parser=ld_parser,
                                 success_codes=[0],
                                 cwd=dirs['abs_work_dir'])
 
         level = INFO