Backed out changeset ec353cd772b1 (bug 989583) for B2G emulator mochitest mass-fail.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 11 Jun 2014 13:55:44 -0400
changeset 209032 ccf7bd357e8b4b37544ef7783b300e9db5ba58a3
parent 209031 3375924678610749626c14af08a869127378d5c4
child 209033 85a48222098a040afcd75d78597ee00a932aedf1
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs989583
milestone33.0a1
backs outec353cd772b16a1921f935b2b4b0a58a370ffc93
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
Backed out changeset ec353cd772b1 (bug 989583) for B2G emulator mochitest mass-fail.
dom/browser-element/mochitest/mochitest.ini
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/test/frontend/data/test-manifest-inactive-ignored/mochitest.ini
python/mozbuild/mozbuild/test/frontend/data/test-manifest-inactive-ignored/moz.build
python/mozbuild/mozbuild/test/frontend/data/test-manifest-inactive-ignored/test_active.html
python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/foo.txt
python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/moz.build
python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/support-disabled-tests.ini
python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/test_blah.html
python/mozbuild/mozbuild/test/frontend/test_emitter.py
testing/mochitest/runtests.py
testing/mochitest/runtestsb2g.py
--- a/dom/browser-element/mochitest/mochitest.ini
+++ b/dom/browser-element/mochitest/mochitest.ini
@@ -191,8 +191,12 @@ skip-if = (toolkit == 'gonk' && !debug)
 [test_browserElement_inproc_XFrameOptionsSameOrigin.html]
 [test_browserElement_oop_NextPaint.html]
 # Disabled due to https://bugzilla.mozilla.org/show_bug.cgi?id=774100
 [test_browserElement_inproc_Reload.html]
 disabled = bug 774100
 # Disabled due to focus issues (no bug that I'm aware of)
 [test_browserElement_oop_KeyEvents.html]
 disabled =
+# Disable due to certificate issue (no bug that I'm aware of)
+[test_browserElement_inproc_ErrorSecurity.html]
+skip-if = buildapp=='b2g'
+disabled =
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -476,17 +476,17 @@ class TreeMetadataEmitter(LoggingMixin):
                 relpath=mozpath.join(manifest_reldir, mozpath.basename(path)),
                 dupe_manifest='dupe-manifest' in defaults)
 
             filtered = m.tests
 
             if filter_inactive:
                 # We return tests that don't exist because we want manifests
                 # defining tests that don't exist to result in error.
-                filtered = m.active_tests(exists=False, disabled=True,
+                filtered = m.active_tests(exists=False, disabled=False,
                     **self.info)
 
                 missing = [t['name'] for t in filtered if not os.path.exists(t['path'])]
                 if missing:
                     raise SandboxValidationError('Test manifest (%s) lists '
                         'test that does not exist: %s' % (
                         path, ', '.join(missing)))
 
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-inactive-ignored/mochitest.ini
@@ -0,0 +1,3 @@
+[test_active.html]
+[test_inactive.html]
+skip-if = true
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-inactive-ignored/moz.build
@@ -0,0 +1,4 @@
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+MOCHITEST_MANIFESTS += ['mochitest.ini']
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/foo.txt
@@ -0,0 +1,1 @@
+hello
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/moz.build
@@ -0,0 +1,4 @@
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+MOCHITEST_MANIFESTS += ['support-disabled-tests.ini']
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/support-disabled-tests.ini
@@ -0,0 +1,5 @@
+[DEFAULT]
+support-files = foo.txt
+
+[test_blah.html]
+disabled =
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/test-manifest-support-disabled-tests/test_blah.html
@@ -0,0 +1,1 @@
+<html></html>
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -316,16 +316,27 @@ class TestEmitterBasic(unittest.TestCase
 
         objs = self.read_topsrcdir(reader)
         self.assertEqual(len(objs), 1)
         o = objs[0]
         self.assertEqual(len(o.installs), 2)
         paths = sorted([k[len(o.directory)+1:] for k in o.installs.keys()])
         self.assertEqual(paths, ["foo.txt", "just-support.ini"])
 
+    def test_test_manifest_support_files_disabled_test(self):
+        """A test manifest with just disabled tests and support-files is supported."""
+        reader = self.reader('test-manifest-support-disabled-tests')
+
+        objs = self.read_topsrcdir(reader)
+        self.assertEqual(len(objs), 1)
+        o = objs[0]
+        self.assertEqual(len(o.installs), 2)
+        paths = sorted([k[len(o.directory)+1:] for k in o.installs.keys()])
+        self.assertEqual(paths, ["foo.txt", "support-disabled-tests.ini"])
+
     def test_test_manifest_absolute_support_files(self):
         """Support files starting with '/' are placed relative to the install root"""
         reader = self.reader('test-manifest-absolute-support')
 
         objs = self.read_topsrcdir(reader)
         self.assertEqual(len(objs), 1)
         o = objs[0]
         self.assertEqual(len(o.installs), 2)
@@ -462,16 +473,33 @@ class TestEmitterBasic(unittest.TestCase
 
     def test_test_manifest_unmatched_generated(self):
         reader = self.reader('test-manifest-unmatched-generated')
 
         with self.assertRaisesRegexp(SandboxValidationError,
             'entry in generated-files not present elsewhere'):
             self.read_topsrcdir(reader),
 
+    # This test is only needed until all harnesses support filtering from
+    # manifests.
+    def test_test_manifest_inactive_ignored(self):
+        """Inactive tests should not be installed."""
+        reader = self.reader('test-manifest-inactive-ignored')
+
+        objs = [o for o in self.read_topsrcdir(reader)
+               if isinstance(o, TestManifest)]
+
+        self.assertEqual(len(objs), 1)
+
+        o = objs[0]
+
+        self.assertEqual(o.flavor, 'mochitest')
+        basenames = set(mozpath.basename(k) for k in o.installs.keys())
+        self.assertEqual(basenames, {'mochitest.ini', 'test_active.html'})
+
     def test_test_manifest_parent_support_files_dir(self):
         """support-files referencing a file in a parent directory works."""
         reader = self.reader('test-manifest-parent-support-files-dir')
 
         objs = [o for o in self.read_topsrcdir(reader)
                 if isinstance(o, TestManifest)]
 
         self.assertEqual(len(objs), 1)
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -441,25 +441,21 @@ class MochitestUtilsMixin(object):
     if os.path.isfile(os.path.join(self.oldcwd, os.path.dirname(__file__), self.TEST_PATH, testPath)) and options.repeat > 0:
       testURL = "/".join([testHost, self.TEST_PATH, os.path.dirname(testPath)])
     if options.chrome or options.a11y:
       testURL = "/".join([testHost, self.CHROME_PATH])
     elif options.browserChrome:
       testURL = "about:blank"
     return testURL
 
-  def buildTestPath(self, options, disabled=True):
+  def buildTestPath(self, options):
     """ Build the url path to the specific test harness and test file or directory
         Build a manifest of tests to run and write out a json file for the harness to read
-
-        disabled -- This allows to add all disabled tests on the build side
-                    and then on the run side to only run the enabled ones
     """
-    self.testRoot = self.getTestRoot(options)
-    self.testRootAbs = os.path.join(SCRIPT_DIR, self.testRoot)
+    manifest = None
     manifest = self.getTestManifest(options)
 
     if manifest:
       # Python 2.6 doesn't allow unicode keys to be used for keyword
       # arguments. This gross hack works around the problem until we
       # rid ourselves of 2.6.
       info = {}
       for k, v in mozinfo.info.items():
@@ -470,35 +466,35 @@ class MochitestUtilsMixin(object):
       # Bug 883858 - return all tests including disabled tests
       testPath = self.getTestPath(options)
       testPath = testPath.replace('\\', '/')
       if testPath.endswith('.html') or \
          testPath.endswith('.xhtml') or \
          testPath.endswith('.xul') or \
          testPath.endswith('.js'):
           # In the case where we have a single file, we don't want to filter based on options such as subsuite.
-          tests = manifest.active_tests(disabled=disabled, options=None, **info)
+          tests = manifest.active_tests(disabled=True, options=None, **info)
           for test in tests:
               if 'disabled' in test:
                   del test['disabled']
       else:
-          tests = manifest.active_tests(disabled=disabled, options=options, **info)
+          tests = manifest.active_tests(disabled=True, options=options, **info)
       paths = []
 
       for test in tests:
         pathAbs = os.path.abspath(test['path'])
         assert pathAbs.startswith(self.testRootAbs)
         tp = pathAbs[len(self.testRootAbs):].replace('\\', '/').strip('/')
 
         # Filter out tests if we are using --test-path
         if testPath and not tp.startswith(testPath):
           continue
 
         if not self.isTest(options, tp):
-          log.warning('Warning: %s from manifest %s is not a valid test' % (test['name'], test['manifest']))
+          print 'Warning: %s from manifest %s is not a valid test' % (test['name'], test['manifest'])
           continue
 
         testob = {'path': tp}
         if test.has_key('disabled'):
           testob['disabled'] = test['disabled']
         paths.append(testob)
 
       # Sort tests so they are run in a deterministic order.
--- a/testing/mochitest/runtestsb2g.py
+++ b/testing/mochitest/runtestsb2g.py
@@ -61,18 +61,17 @@ class B2GMochitest(MochitestUtilsMixin):
 
     def setup_common_options(self, options):
         test_url = self.buildTestPath(options)
         if len(self.urlOpts) > 0:
             test_url += "?" + "&".join(self.urlOpts)
         self.test_script_args.append(test_url)
 
     def buildTestPath(self, options):
-        if options.manifestFile != 'tests.json':
-            super(B2GMochitest, self).buildTestPath(options, disabled=False)
+        # Skip over the manifest building that happens on desktop.
         return self.buildTestURL(options)
 
     def build_profile(self, options):
         # preferences
         prefs = {}
         for path in self.preferences:
             prefs.update(Preferences.read_prefs(path))
 
@@ -159,24 +158,23 @@ class B2GMochitest(MochitestUtilsMixin):
 
         log.info("runtestsb2g.py | Running tests: end.")
 
         if manifest is not None:
             self.cleanup(manifest, options)
         return status
 
 
-class B2GDeviceMochitest(B2GMochitest, Mochitest):
+class B2GDeviceMochitest(B2GMochitest):
 
     _dm = None
 
     def __init__(self, marionette, devicemanager, profile_data_dir,
                  local_binary_dir, remote_test_root=None, remote_log_file=None):
         B2GMochitest.__init__(self, marionette, out_of_process=True, profile_data_dir=profile_data_dir)
-        Mochitest.__init__(self)
         self._dm = devicemanager
         self.remote_test_root = remote_test_root or self._dm.getDeviceRoot()
         self.remote_profile = posixpath.join(self.remote_test_root, 'profile')
         self.remote_log = remote_log_file or posixpath.join(self.remote_test_root, 'log', 'mochitest.log')
         self.local_log = None
         self.local_binary_dir = local_binary_dir
 
         if not self._dm.dirExists(posixpath.dirname(self.remote_log)):
@@ -217,19 +215,16 @@ class B2GDeviceMochitest(B2GMochitest, M
     def buildURLOptions(self, options, env):
         self.local_log = options.logFile
         options.logFile = self.remote_log
         options.profilePath = self.profile.profile
         retVal = super(B2GDeviceMochitest, self).buildURLOptions(options, env)
 
         self.setup_common_options(options)
 
-        # buildURLOptions has already been called so we're hacking it here
-        self.urlOpts.append("manifestFile=%s" % options.manifestFile)
-
         options.profilePath = self.remote_profile
         options.logFile = self.local_log
         return retVal
 
 
 class B2GDesktopMochitest(B2GMochitest, Mochitest):
 
     def __init__(self, marionette, profile_data_dir):