Commits

Anonymous committed ba711ae

Backout to 9842ccd31245

  • Participants
  • Parent commits 09a10aa

Comments (0)

Files changed (3)

File configs/b2g/emulator_automation_config.py

     ],
     "download_symbols": "ondemand",
     "download_minidump_stackwalk": True,
-
-    # test harness options
-    "run_file_names": {
-        "mochitest": "runtestsb2g.py",
-        "reftest": "runreftestb2g.py",
-        "xpcshell": "runtestsb2g.py"
-    },
-
-    "mochitest_options": [
-        "--adbpath=%(adbpath)s", "--b2gpath=%(b2gpath)s", "--console-level=INFO",
-        "--emulator=%(emulator)s", "--logcat-dir=%(logcat_dir)s",
-        "--remote-webserver=%(remote_webserver)s", "--test-manifest=%(test_manifest)s",
-        "--xre-path=%(xre_path)s", "--gecko-path=%(gecko_path)s",
-        "--symbols-path=%(symbols_path)s", "--busybox=%(busybox)s",
-        "--total-chunks=%(total_chunks)s", "--this-chunk=%(this_chunk)s",
-    ],
-
-    "reftest_options": [
-        "--adbpath=%(adbpath)s", "--b2gpath=%(b2gpath)s", "--emulator=%(emulator)s",
-        "--emulator-res=800x1000", "--logcat-dir=%(logcat_dir)s",
-        "--remote-webserver=%(remote_webserver)s", "--ignore-window-size",
-        "--xre-path=%(xre_path)s", "--gecko-path=%(gecko_path)s",
-        "--symbols-path=%(symbols_path)s", "--busybox=%(busybox)s",
-        "--total-chunks=%(total_chunks)s", "--this-chunk=%(this_chunk)s",
-        "%(test_manifest)s",
-    ],
-
-    "xpcshell_options": [
-        "--adbpath=%(adbpath)s", "--b2gpath=%(b2gpath)s", "--emulator=%(emulator)s",
-        "--logcat-dir=%(logcat_dir)s", "--manifest=%(test_manifest)s",
-        "--testing-modules-dir=%(modules_dir)s", "--gecko-path=%(gecko_path)s",
-        "--symbols-path=%(symbols_path)s", "--busybox=%(busybox)s",
-        "--total-chunks=%(total_chunks)s", "--this-chunk=%(this_chunk)s",
-    ],
 }

File mozharness/mozilla/testing/testbase.py

 import os
 import platform
 
-from mozharness.base.config import ReadOnlyDict, parse_config_file
 from mozharness.base.errors import BaseErrorList
 from mozharness.base.log import FATAL
 from mozharness.base.python import virtualenv_config_options, VirtualenvMixin
         # TODO error_list
         self.run_command(unzip_cmd, cwd=test_install_dir, halt_on_failure=True)
 
-    def _read_tree_config(self):
-        """Reads an in-tree config file and overrides current values"""
-        dirs = self.query_abs_dirs()
-        test_install_dir = dirs.get('abs_test_install_dir',
-                                    os.path.join(dirs['abs_work_dir'], 'tests'))
-        tree_config_path = os.path.join(test_install_dir, 'config', 'mozharness_config.py')
-        if os.path.isfile(tree_config_path):
-            rw_config = self.config.copy()
-            rw_config.update(parse_config_file(tree_config_path))
-            self.config = ReadOnlyDict(rw_config)
-            self.config.lock()
-
     def _download_installer(self):
         file_name = None
         if self.installer_path:
         if self.test_url:
             self._download_test_zip()
             self._extract_test_zip(target_unzip_dirs=target_unzip_dirs)
-            self._read_tree_config()
         self._download_installer()
         if self.config.get('download_symbols'):
             self._download_and_extract_symbols()

File scripts/b2g_emulator_unittest.py

                                parent_dir=dirs['abs_work_dir'])
             self.busybox_path = os.path.join(dirs['abs_work_dir'], 'busybox')
 
-    def _query_abs_base_cmd(self, suite):
+    def _build_mochitest_args(self):
+        c = self.config
         dirs = self.query_abs_dirs()
-        cmd = [self.query_python_path('python')]
-        cmd.append(self.config['run_file_names'][suite])
+        python = self.query_python_path('python')
+        cmd = [
+            python, os.path.join(dirs['abs_mochitest_dir'], 'runtestsb2g.py'),
+            '--adbpath', self.adb_path,
+            '--b2gpath', dirs['abs_b2g-distro_dir'],
+            '--console-level', 'INFO',
+            '--emulator', c['emulator'],
+            '--logcat-dir', dirs['abs_work_dir'],
+            '--remote-webserver', c['remote_webserver'],
+            '--run-only-tests', self.test_manifest,
+            '--xre-path', os.path.join(dirs['abs_xre_dir'], 'bin'),
+        ]
+        cmd.extend(self._build_arg('--total-chunks', c.get('total_chunks')))
+        cmd.extend(self._build_arg('--this-chunk', c.get('this_chunk')))
+        # self.binary_path gets set by super(B2GEmulatorTest, self).install()
+        cmd.extend(self._build_arg('--gecko-path', os.path.dirname(self.binary_path)))
+        cmd.extend(self._build_arg('--busybox', self.busybox_path))
+        cmd.extend(self._build_arg('--symbols-path', self.symbols_path))
+        return cmd
 
-        str_format_values = {
-            'adbpath': self.adb_path,
-            'b2gpath': dirs['abs_b2g-distro_dir'],
-            'emulator': self.config['emulator'],
-            'logcat_dir': dirs['abs_work_dir'],
-            'remote_webserver': self.config['remote_webserver'],
-            'xre_path': os.path.join(dirs['abs_xre_dir'], 'bin'),
-            'test_manifest': self.test_manifest,
-            'gecko_path': os.path.dirname(self.binary_path),
-            'symbols_path': self.symbols_path,
-            'busybox': self.busybox_path,
-            'total_chunks': self.config.get('total_chunks'),
-            'this_chunk': self.config.get('this_chunk'),
-        }
+    def _build_reftest_args(self):
+        c = self.config
+        dirs = self.query_abs_dirs()
+        python = self.query_python_path('python')
+        cmd = [
+            python, 'runreftestb2g.py',
+            '--adbpath', self.adb_path,
+            '--b2gpath', dirs['abs_b2g-distro_dir'],
+            '--emulator', c['emulator'],
+            '--emulator-res', '800x1000',
+            '--ignore-window-size',
+            '--logcat-dir', dirs['abs_work_dir'],
+            '--remote-webserver', c['remote_webserver'],
+            '--xre-path', os.path.join(dirs['abs_xre_dir'], 'bin'),
+        ]
+        cmd.extend(self._build_arg('--total-chunks', c.get('total_chunks')))
+        cmd.extend(self._build_arg('--this-chunk', c.get('this_chunk')))
+        # self.binary_path gets set by super(B2GEmulatorTest, self).install()
+        cmd.extend(self._build_arg('--gecko-path', os.path.dirname(self.binary_path)))
+        cmd.extend(self._build_arg('--busybox', self.busybox_path))
+        cmd.extend(self._build_arg('--symbols-path', self.symbols_path))
+        cmd.append(self.test_manifest)
+        return cmd
 
-        if self.config.get('%s_options' % suite):
-            for option in self.config['%s_options' % suite]:
-                option = option % str_format_values
-                if not option.endswith('None'):
-                    cmd.append(option)
+    def _build_xpcshell_args(self):
+        c = self.config
+        dirs = self.query_abs_dirs()
+        python = self.query_python_path('python')
+        cmd = [
+            python, 'runtestsb2g.py',
+            '--adbpath', self.adb_path,
+            '--b2gpath', dirs['abs_b2g-distro_dir'],
+            '--emulator', c['emulator'],
+            '--gecko-path', os.path.dirname(self.binary_path),
+            '--logcat-dir', dirs['abs_work_dir'],
+            '--manifest', self.test_manifest,
+            '--testing-modules-dir', dirs['abs_modules_dir'],
+            '--use-device-libs',
+        ]
+        cmd.extend(self._build_arg('--total-chunks', c.get('total_chunks')))
+        cmd.extend(self._build_arg('--this-chunk', c.get('this_chunk')))
+        cmd.extend(self._build_arg('--busybox', self.busybox_path))
+        cmd.extend(self._build_arg('--symbols-path', self.symbols_path))
         return cmd
 
     def _query_adb(self):
         error_list = self.error_list
         error_list.extend(BaseErrorList)
 
-        suite = self.config['test_suite']
-        if suite == 'crashtest':
-            suite = 'reftest'
-        if suite not in ('reftest', 'mochitest', 'xpcshell'):
-            self.fatal("Don't know how to run --test-suite '%s'!" % suite)
-
-        cmd = self._query_abs_base_cmd(suite)
-        cwd = dirs['abs_%s_dir' % suite]
-
+        if self.config['test_suite'] == 'mochitest':
+            cmd = self._build_mochitest_args()
+            cwd = dirs['abs_mochitest_dir']
+        elif self.config['test_suite'] in ('reftest', 'crashtest'):
+            cmd = self._build_reftest_args()
+            cwd = dirs['abs_reftest_dir']
+        elif self.config['test_suite'] == 'xpcshell':
+            cmd = self._build_xpcshell_args()
+            cwd = dirs['abs_xpcshell_dir']
+        else:
+            self.fatal("Don't know how to run --test-suite '%s'!" % self.config['test_suite'])
         # TODO we probably have to move some of the code in
         # scripts/desktop_unittest.py and scripts/marionette.py to
         # mozharness.mozilla.testing.unittest so we can share it.