Backed out changeset ec353cd772b1 (bug 989583) for B2G emulator mochitest mass-fail.

This commit is contained in:
Ryan VanderMeulen 2014-06-11 13:55:44 -04:00
Родитель f8bfd440bd
Коммит e0b5408f8b
12 изменённых файлов: 58 добавлений и 17 удалений

Просмотреть файл

@ -196,3 +196,7 @@ 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 =

Просмотреть файл

@ -481,7 +481,7 @@ class TreeMetadataEmitter(LoggingMixin):
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'])]

Просмотреть файл

@ -0,0 +1,3 @@
[test_active.html]
[test_inactive.html]
skip-if = true

Просмотреть файл

@ -0,0 +1,4 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
MOCHITEST_MANIFESTS += ['mochitest.ini']

Просмотреть файл

Просмотреть файл

@ -0,0 +1 @@
hello

Просмотреть файл

@ -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']

Просмотреть файл

@ -0,0 +1,5 @@
[DEFAULT]
support-files = foo.txt
[test_blah.html]
disabled =

Просмотреть файл

@ -0,0 +1 @@
<html></html>

Просмотреть файл

@ -321,6 +321,17 @@ class TestEmitterBasic(unittest.TestCase):
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')
@ -467,6 +478,23 @@ class TestEmitterBasic(unittest.TestCase):
'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')

Просмотреть файл

@ -446,15 +446,11 @@ class MochitestUtilsMixin(object):
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:
@ -475,12 +471,12 @@ class MochitestUtilsMixin(object):
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:
@ -493,7 +489,7 @@ class MochitestUtilsMixin(object):
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}

Просмотреть файл

@ -66,8 +66,7 @@ class B2GMochitest(MochitestUtilsMixin):
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):
@ -164,14 +163,13 @@ class B2GMochitest(MochitestUtilsMixin):
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')
@ -222,9 +220,6 @@ class B2GDeviceMochitest(B2GMochitest, Mochitest):
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