mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-12 15:02:11 +00:00
Bug 1606335 - [marionette] Remove non-e10s support from Marionette harness. r=marionette-reviewers,ato
Differential Revision: https://phabricator.services.mozilla.com/D58811 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
3225b46d32
commit
3af0c863ac
@ -5,7 +5,7 @@
|
||||
from __future__ import absolute_import
|
||||
from firefox_puppeteer import PuppeteerMixin
|
||||
from marionette_driver import Wait
|
||||
from marionette_harness import MarionetteTestCase, skip_if_e10s
|
||||
from marionette_harness import MarionetteTestCase, skip
|
||||
|
||||
|
||||
class TestSSLStatusAfterRestart(PuppeteerMixin, MarionetteTestCase):
|
||||
@ -45,7 +45,7 @@ class TestSSLStatusAfterRestart(PuppeteerMixin, MarionetteTestCase):
|
||||
finally:
|
||||
super(TestSSLStatusAfterRestart, self).tearDown()
|
||||
|
||||
@skip_if_e10s("Bug 1325047")
|
||||
@skip("Bug 1325047 - Tests fails when run with multiple processes")
|
||||
def test_ssl_status_after_restart(self):
|
||||
for item in self.test_data:
|
||||
with self.marionette.using_context('content'):
|
||||
|
@ -14,7 +14,7 @@ granted commit access level 1 you will have permission to use the
|
||||
|
||||
This is a good try syntax to use when testing Marionette changes:
|
||||
|
||||
-b do -p linux,linux64,macosx64,win64,android-api-16 -u marionette-e10s,marionette-headless-e10s,xpcshell,web-platform-tests,firefox-ui-functional -t none
|
||||
-b do -p linux,linux64,macosx64,win64,android-api-16 -u marionette,marionette-headless,xpcshell,web-platform-tests,firefox-ui-functional -t none
|
||||
|
||||
[Phabricator]: https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html
|
||||
[commit creation guidelines]: https://mozilla-version-control-tools.readthedocs.io/en/latest/devguide/contributing.html?highlight=phabricator#submitting-patches-for-review
|
||||
|
@ -88,7 +88,7 @@ it inside the already sourced virtual environment.
|
||||
Here an example for chunk 1 which runs all the tests in the current
|
||||
chunk with some options for logs removed:
|
||||
|
||||
% /builds/worker/workspace/build/venv/bin/python -u /builds/worker/workspace/build/tests/marionette/harness/marionette_harness/runtests.py --emulator --app=fennec --package=org.mozilla.fennec_aurora --address=127.0.0.1:2828 /builds/worker/workspace/build/tests/marionette/tests/testing/marionette/harness/marionette_harness/tests/unit-tests.ini --disable-e10s --gecko-log=- --symbols-path=/builds/worker/workspace/build/symbols --startup-timeout=300 --this-chunk 1 --total-chunks 10
|
||||
% /builds/worker/workspace/build/venv/bin/python -u /builds/worker/workspace/build/tests/marionette/harness/marionette_harness/runtests.py --emulator --app=fennec --package=org.mozilla.fennec_aurora --address=127.0.0.1:2828 /builds/worker/workspace/build/tests/marionette/tests/testing/marionette/harness/marionette_harness/tests/unit-tests.ini --gecko-log=- --symbols-path=/builds/worker/workspace/build/symbols --startup-timeout=300 --this-chunk 1 --total-chunks 10
|
||||
|
||||
To execute a specific test only simply replace `unit-tests.ini`
|
||||
with its name.
|
||||
|
@ -119,8 +119,7 @@ option. Marionette Test Runner will take care of forwarding the port and
|
||||
starting Fennec with the correct prefs. (You may need to run
|
||||
`adb forward --remove-all` to allow the runner to start.)
|
||||
|
||||
% ./mach marionette-test --emulator --app='fennec' --address=127.0.0.1:2828 --disable-e10s
|
||||
--startup-timeout=300
|
||||
% ./mach marionette-test --emulator --app='fennec' --address=127.0.0.1:2828 --startup-timeout=300
|
||||
|
||||
If you need to troubleshoot the Marionette connection, the most basic check is
|
||||
to start Fennec, make sure the `marionette.enabled` browser preference is
|
||||
|
@ -11,12 +11,10 @@ from .marionette_test import (
|
||||
expectedFailure,
|
||||
MarionetteTestCase,
|
||||
parameterized,
|
||||
run_if_e10s,
|
||||
run_if_manage_instance,
|
||||
skip,
|
||||
skip_if_chrome,
|
||||
skip_if_desktop,
|
||||
skip_if_e10s,
|
||||
SkipTest,
|
||||
skip_unless_protocol,
|
||||
)
|
||||
|
@ -14,11 +14,9 @@ from unittest.case import (
|
||||
|
||||
from .decorators import (
|
||||
parameterized,
|
||||
run_if_e10s,
|
||||
run_if_manage_instance,
|
||||
skip_if_chrome,
|
||||
skip_if_desktop,
|
||||
skip_if_e10s,
|
||||
skip_unless_browser_pref,
|
||||
skip_unless_protocol,
|
||||
with_parameters,
|
||||
|
@ -48,29 +48,6 @@ def parameterized(func_suffix, *args, **kwargs):
|
||||
return wrapped
|
||||
|
||||
|
||||
def run_if_e10s(reason):
|
||||
"""Decorator which runs a test if e10s mode is active."""
|
||||
def decorator(test_item):
|
||||
if not isinstance(test_item, types.FunctionType):
|
||||
raise Exception('Decorator only supported for functions')
|
||||
|
||||
@functools.wraps(test_item)
|
||||
def skip_wrapper(self, *args, **kwargs):
|
||||
with self.marionette.using_context('chrome'):
|
||||
multi_process_browser = not self.marionette.execute_script("""
|
||||
try {
|
||||
return Services.appinfo.browserTabsRemoteAutostart;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
""")
|
||||
if multi_process_browser:
|
||||
raise SkipTest(reason)
|
||||
return test_item(self, *args, **kwargs)
|
||||
return skip_wrapper
|
||||
return decorator
|
||||
|
||||
|
||||
def run_if_manage_instance(reason):
|
||||
"""Decorator which runs a test if Marionette manages the application instance."""
|
||||
def decorator(test_item):
|
||||
@ -116,29 +93,6 @@ def skip_if_desktop(reason):
|
||||
return decorator
|
||||
|
||||
|
||||
def skip_if_e10s(reason):
|
||||
"""Decorator which skips a test if e10s mode is active."""
|
||||
def decorator(test_item):
|
||||
if not isinstance(test_item, types.FunctionType):
|
||||
raise Exception('Decorator only supported for functions')
|
||||
|
||||
@functools.wraps(test_item)
|
||||
def skip_wrapper(self, *args, **kwargs):
|
||||
with self.marionette.using_context('chrome'):
|
||||
multi_process_browser = self.marionette.execute_script("""
|
||||
try {
|
||||
return Services.appinfo.browserTabsRemoteAutostart;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
""")
|
||||
if multi_process_browser:
|
||||
raise SkipTest(reason)
|
||||
return test_item(self, *args, **kwargs)
|
||||
return skip_wrapper
|
||||
return decorator
|
||||
|
||||
|
||||
def skip_unless_browser_pref(reason, pref, predicate=bool):
|
||||
"""Decorator which skips a test based on the value of a browser preference.
|
||||
|
||||
|
@ -357,11 +357,6 @@ class BaseMarionetteArguments(ArgumentParser):
|
||||
self.add_argument('--pydebugger',
|
||||
help='Enable python post-mortem debugger when a test fails.'
|
||||
' Pass in the debugger you want to use, eg pdb or ipdb.')
|
||||
self.add_argument('--disable-e10s',
|
||||
action='store_false',
|
||||
dest='e10s',
|
||||
default=True,
|
||||
help='Disable e10s when running marionette tests.')
|
||||
self.add_argument('--enable-fission',
|
||||
action='store_true',
|
||||
dest='enable_fission',
|
||||
@ -531,7 +526,7 @@ class BaseMarionetteTestRunner(object):
|
||||
socket_timeout=None,
|
||||
startup_timeout=None,
|
||||
addons=None, workspace=None,
|
||||
verbose=0, e10s=True, emulator=False, headless=False,
|
||||
verbose=0, emulator=False, headless=False,
|
||||
enable_webrender=False, enable_fission=False, **kwargs):
|
||||
self._appName = None
|
||||
self._capabilities = None
|
||||
@ -582,16 +577,6 @@ class BaseMarionetteTestRunner(object):
|
||||
'fission.autostart': True,
|
||||
})
|
||||
|
||||
# self.e10s stores the desired configuration, whereas
|
||||
# self._e10s_from_browser is the cached value from querying e10s
|
||||
# in self.is_e10s
|
||||
self.e10s = e10s
|
||||
self._e10s_from_browser = None
|
||||
if self.e10s:
|
||||
self.prefs.update({
|
||||
'browser.tabs.remote.autostart': True,
|
||||
})
|
||||
|
||||
# If no repeat has been set, default to 30 extra runs
|
||||
if self.run_until_failure and repeat is None:
|
||||
self.repeat = 30
|
||||
@ -852,22 +837,6 @@ class BaseMarionetteTestRunner(object):
|
||||
message=test['disabled'])
|
||||
self.todo += 1
|
||||
|
||||
@property
|
||||
def is_e10s(self):
|
||||
"""Query the browser on whether E10s (Electrolysis) is enabled."""
|
||||
if self.marionette is None or self.marionette.session is None:
|
||||
self._e10s_from_browser = None
|
||||
raise Exception("No Marionette session to query e10s state")
|
||||
|
||||
if self._e10s_from_browser is not None:
|
||||
return self._e10s_from_browser
|
||||
|
||||
with self.marionette.using_context("chrome"):
|
||||
self._e10s_from_browser = self.marionette.execute_script(
|
||||
"return Services.appinfo.browserTabsRemoteAutostart")
|
||||
|
||||
return self._e10s_from_browser
|
||||
|
||||
def run_tests(self, tests):
|
||||
start_time = time.time()
|
||||
self._initialize_test_run(tests)
|
||||
@ -895,14 +864,6 @@ class BaseMarionetteTestRunner(object):
|
||||
except Exception:
|
||||
self.logger.warning('Could not get device info', exc_info=True)
|
||||
|
||||
self.marionette.start_session()
|
||||
self.logger.info("e10s is {}".format("enabled" if self.is_e10s else "disabled"))
|
||||
if self.e10s != self.is_e10s:
|
||||
self.cleanup()
|
||||
raise AssertionError("BaseMarionetteTestRunner configuration (self.e10s) "
|
||||
"does not match browser appinfo (self.is_e10s)")
|
||||
self.marionette.delete_session()
|
||||
|
||||
tests_by_group = defaultdict(list)
|
||||
for test in self.tests:
|
||||
tests_by_group[test['group']].append(test['filepath'])
|
||||
@ -1020,7 +981,6 @@ class BaseMarionetteTestRunner(object):
|
||||
|
||||
values = {
|
||||
"appname": self.appName,
|
||||
"e10s": self.e10s,
|
||||
"manage_instance": self.marionette.instance is not None,
|
||||
"headless": self.headless
|
||||
}
|
||||
|
@ -40,7 +40,6 @@ def mach_parsed_kwargs(logger):
|
||||
'browsermob_port': None,
|
||||
'browsermob_script': None,
|
||||
'device_serial': None,
|
||||
'e10s': True,
|
||||
'emulator': False,
|
||||
'emulator_bin': None,
|
||||
'gecko_log': None,
|
||||
|
@ -34,8 +34,6 @@ def mock_runner(runner, mock_marionette, monkeypatch):
|
||||
for attr in ['run_test', '_capabilities']:
|
||||
setattr(runner, attr, Mock())
|
||||
runner._appName = 'fake_app'
|
||||
# simulate that browser runs with e10s by default
|
||||
runner._e10s_from_browser = True
|
||||
monkeypatch.setattr('marionette_harness.runner.base.mozversion', Mock())
|
||||
return runner
|
||||
|
||||
@ -343,12 +341,6 @@ def test_manifest_basic_args(mock_runner, manifest, monkeypatch):
|
||||
assert 'mozinfo_key' in kwargs and kwargs['mozinfo_key'] == 'mozinfo_val'
|
||||
|
||||
|
||||
@pytest.mark.parametrize('e10s', (True, False))
|
||||
def test_manifest_with_e10s(mock_runner, manifest, monkeypatch, e10s):
|
||||
kwargs = get_kwargs_passed_to_manifest(mock_runner, manifest, monkeypatch, e10s=e10s)
|
||||
assert kwargs['e10s'] == e10s
|
||||
|
||||
|
||||
@pytest.mark.parametrize('test_tags', (None, ['tag', 'tag2']))
|
||||
def test_manifest_with_test_tags(mock_runner, manifest, monkeypatch, test_tags):
|
||||
kwargs = get_kwargs_passed_to_manifest(mock_runner, manifest, monkeypatch, test_tags=test_tags)
|
||||
@ -452,25 +444,6 @@ def test_catch_invalid_test_names(runner):
|
||||
assert good_name not in msg
|
||||
|
||||
|
||||
@pytest.mark.parametrize('e10s', (True, False))
|
||||
def test_option_e10s_sets_prefs(mach_parsed_kwargs, e10s):
|
||||
mach_parsed_kwargs['e10s'] = e10s
|
||||
runner = MarionetteTestRunner(**mach_parsed_kwargs)
|
||||
e10s_prefs = {
|
||||
'browser.tabs.remote.autostart': True,
|
||||
}
|
||||
for k,v in e10s_prefs.iteritems():
|
||||
assert runner.prefs.get(k, False) == (v and e10s)
|
||||
|
||||
|
||||
def test_option_e10s_clash_raises(mock_runner):
|
||||
mock_runner._e10s_from_browser = False
|
||||
|
||||
with pytest.raises(AssertionError) as e:
|
||||
mock_runner.run_tests([u'test_fake_thing.py'])
|
||||
assert "configuration (self.e10s) does not match browser appinfo" in e.value.message
|
||||
|
||||
|
||||
@pytest.mark.parametrize('repeat', (None, 0, 42, -1))
|
||||
def test_option_repeat(mach_parsed_kwargs, repeat):
|
||||
if repeat is not None:
|
||||
|
@ -11,7 +11,6 @@ from marionette_driver.marionette import Alert
|
||||
|
||||
from marionette_harness import (
|
||||
MarionetteTestCase,
|
||||
run_if_e10s,
|
||||
WindowManagerMixin,
|
||||
)
|
||||
|
||||
@ -428,7 +427,6 @@ class TestClickNavigation(MarionetteTestCase):
|
||||
self.marionette.find_element(By.ID, "option").click()
|
||||
self.marionette.find_element(By.ID, "delay")
|
||||
|
||||
@run_if_e10s("Requires e10s mode enabled")
|
||||
def test_click_remoteness_change(self):
|
||||
self.marionette.navigate("about:robots")
|
||||
self.marionette.navigate(self.test_page)
|
||||
|
@ -17,7 +17,7 @@ from marionette_driver.errors import (
|
||||
TimeoutException
|
||||
)
|
||||
|
||||
from marionette_harness import MarionetteTestCase, expectedFailure, run_if_e10s
|
||||
from marionette_harness import MarionetteTestCase, expectedFailure
|
||||
|
||||
# Import runner module to monkey patch mozcrash module
|
||||
from mozrunner.base import runner
|
||||
@ -135,7 +135,6 @@ class TestCrash(BaseCrashTestCase):
|
||||
|
||||
self.marionette.get_url()
|
||||
|
||||
@run_if_e10s("Content crashes only exist in e10s mode")
|
||||
def test_crash_content_process(self):
|
||||
# For a content process crash and MOZ_CRASHREPORTER_SHUTDOWN set the top
|
||||
# browsing context will be gone first. As such the raised NoSuchWindowException
|
||||
|
@ -13,7 +13,6 @@ from marionette_driver.keys import Keys
|
||||
from marionette_driver.marionette import Alert
|
||||
from marionette_harness import (
|
||||
MarionetteTestCase,
|
||||
run_if_e10s,
|
||||
run_if_manage_instance,
|
||||
skip,
|
||||
WindowManagerMixin,
|
||||
@ -182,7 +181,6 @@ class TestNavigate(BaseNavigationTestCase):
|
||||
self.marionette.navigate(self.marionette.absolute_url("slow"))
|
||||
self.assertEqual(self.is_remote_tab, is_remote_before_timeout)
|
||||
|
||||
@run_if_e10s("Requires e10s mode enabled")
|
||||
def test_navigate_timeout_error_remoteness_change(self):
|
||||
self.assertTrue(self.is_remote_tab)
|
||||
self.marionette.navigate("about:robots")
|
||||
@ -263,7 +261,6 @@ class TestNavigate(BaseNavigationTestCase):
|
||||
self.marionette.find_element(By.ID, "file-url")
|
||||
self.marionette.navigate(self.test_page_remote)
|
||||
|
||||
@run_if_e10s("Requires e10s mode enabled")
|
||||
def test_navigate_file_url_remoteness_change(self):
|
||||
self.marionette.navigate("about:robots")
|
||||
self.assertFalse(self.is_remote_tab)
|
||||
@ -311,7 +308,6 @@ class TestNavigate(BaseNavigationTestCase):
|
||||
message="'about:support' hasn't been loaded")
|
||||
self.assertFalse(self.is_remote_tab)
|
||||
|
||||
@run_if_e10s("Requires e10s mode enabled")
|
||||
def test_type_to_remote_tab(self):
|
||||
self.assertTrue(self.is_remote_tab)
|
||||
|
||||
@ -507,7 +503,6 @@ class TestBackForwardNavigation(BaseNavigationTestCase):
|
||||
]
|
||||
self.run_bfcache_test(test_pages)
|
||||
|
||||
@run_if_e10s("Requires e10s mode enabled")
|
||||
def test_remoteness_change(self):
|
||||
test_pages = [
|
||||
{"url": "about:robots", "is_remote": False},
|
||||
@ -787,7 +782,6 @@ class TestPageLoadStrategy(BaseNavigationTestCase):
|
||||
self.assertEqual("complete", self.ready_state)
|
||||
self.marionette.find_element(By.ID, "slow")
|
||||
|
||||
@run_if_e10s("Requires e10s mode enabled")
|
||||
def test_strategy_after_remoteness_change(self):
|
||||
"""Bug 1378191 - Reset of capabilities after listener reload."""
|
||||
self.marionette.delete_session()
|
||||
|
@ -98,10 +98,6 @@ class MarionetteTest(MachCommandBase):
|
||||
tests = [os.path.join(self.topsrcdir,
|
||||
"testing/marionette/harness/marionette_harness/tests/unit-tests.ini")]
|
||||
|
||||
# Force disable e10s because it is not supported in Fennec
|
||||
if kwargs.get("app") == "fennec":
|
||||
kwargs["e10s"] = False
|
||||
|
||||
if not kwargs.get("binary") and \
|
||||
(conditions.is_firefox(self) or conditions.is_thunderbird(self)):
|
||||
kwargs["binary"] = self.get_binary_path("app")
|
||||
|
Loading…
x
Reference in New Issue
Block a user