author | Geoff Brown <gbrown@mozilla.com> |
Thu, 11 Oct 2018 14:00:31 -0600 | |
changeset 440707 | 70cd3032975a7f09b205ccb7e9555fa8219a749a |
parent 440706 | fd60c9679d21619ec33574aa7c054850a43f5e88 |
child 440708 | 1cec1e9365524792ae0aeb11e53c33885f77f44e |
push id | 108847 |
push user | gbrown@mozilla.com |
push date | Thu, 11 Oct 2018 20:00:48 +0000 |
treeherder | mozilla-inbound@70cd3032975a [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jmaher |
bugs | 1498289 |
milestone | 64.0a1 |
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
|
--- a/taskcluster/ci/test/misc.yml +++ b/taskcluster/ci/test/misc.yml @@ -1,32 +1,8 @@ -geckoview: - description: "Geckoview run" - suite: geckoview - treeherder-symbol: gv - instance-size: xlarge - loopback-video: true - e10s: false - target: geckoview_example.apk - mozharness: - script: android_emulator_unittest.py - config: - by-test-platform: - android-em-4.2-x86/opt: - - android/android_common.py - - android/androidx86.py - android-em-7.0-x86/opt: - - android/android_common.py - - android/androidx86_7_0.py - android-em.*: - - android/android_common.py - - android/androidarm_4_3.py - extra-options: - - --test-suite=geckoview - geckoview-junit: description: "Geckoview junit run" suite: geckoview-junit treeherder-symbol: gv-junit instance-size: xlarge loopback-video: true e10s: true target: geckoview-androidTest.apk
--- a/taskcluster/ci/test/test-platforms.yml +++ b/taskcluster/ci/test/test-platforms.yml @@ -315,29 +315,27 @@ macosx64-ccov/debug: # Android platforms (matching /android-em.*/) # # android-em test platforms execute on android emulators. android-em-4.3-arm7-api-16/debug: build-platform: android-api-16/debug test-sets: - android-common-tests - - android-gradle-tests android-em-4.3-arm7-api-16-ccov/debug: build-platform: android-api-16-ccov/debug test-sets: - android-ccov-tests android-em-4.3-arm7-api-16/opt: build-platform: android-api-16/opt test-sets: - android-common-tests - android-opt-tests - - android-gradle-tests android-em-4.2-x86/opt: build-platform: android-x86/opt test-sets: - android-x86-tests android-em-7.0-x86/opt: build-platform: android-x86/opt
--- a/taskcluster/ci/test/test-sets.yml +++ b/taskcluster/ci/test/test-sets.yml @@ -383,24 +383,19 @@ android-common-tests: - reftest - test-verify - xpcshell android-opt-tests: # Robocop tests often fail on Debug builds - robocop -android-gradle-tests: - # geckoview_example is only built in gradle builds - - geckoview - android-x86-tests: - mochitest-chrome - xpcshell - - geckoview android-x86-kvm-tests: - crashtest - geckoview-junit - jsreftest # - mochitest # - mochitest-chrome - mochitest-clipboard
--- a/testing/mochitest/moz.build +++ b/testing/mochitest/moz.build @@ -109,17 +109,16 @@ TEST_HARNESS_FILES.testing.mochitest += 'leaks.py', 'mach_test_package_commands.py', 'manifest.webapp', 'manifestLibrary.js', 'mochitest_options.py', 'nested_setup.js', 'pywebsocket_wrapper.py', 'redirect.html', - 'rungeckoview.py', 'runjunit.py', 'runrobocop.py', 'runtests.py', 'runtestsremote.py', 'server.js', 'start_desktop.js', ]
deleted file mode 100644 --- a/testing/mochitest/rungeckoview.py +++ /dev/null @@ -1,246 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - - -import posixpath -import shutil -import sys -import tempfile -import time -import traceback -from optparse import OptionParser - -import mozcrash -import mozlog -from mozdevice import ADBAndroid -from mozprofile import Profile - - -class GeckoviewOptions(OptionParser): - def __init__(self): - OptionParser.__init__(self) - self.add_option("--utility-path", - action="store", type="string", dest="utility_path", - default=None, - help="absolute path to directory containing utility programs") - self.add_option("--symbols-path", - action="store", type="string", dest="symbols_path", - default=None, - help="absolute path to directory containing breakpad symbols, \ - or the URL of a zip file containing symbols") - self.add_option("--appname", - action="store", type="string", dest="app", - default="org.mozilla.geckoview_example", - help="geckoview_example package name") - self.add_option("--deviceSerial", - action="store", type="string", dest="deviceSerial", - default=None, - help="serial ID of remote device to test") - self.add_option("--adbpath", - action="store", type="string", dest="adbPath", - default=None, - help="Path to adb binary.") - self.add_option("--remoteTestRoot", - action="store", type="string", dest="remoteTestRoot", - default=None, - help="remote directory to use as test root \ - (eg. /mnt/sdcard/tests or /data/local/tests)") - - -class GeckoviewTestRunner: - """ - A quick-and-dirty test harness to verify the geckoview_example - app starts without crashing. - """ - - def __init__(self, log, options): - self.log = log - self.device = ADBAndroid(adb=options.adbPath or 'adb', - device=options.deviceSerial, - test_root=options.remoteTestRoot) - self.options = options - self.appname = self.options.app.split('/')[-1] - self.logcat = None - self.build_profile() - self.log.debug("options=%s" % vars(options)) - - def build_profile(self): - test_root = self.device.test_root - self.remote_profile = posixpath.join(test_root, 'gv-profile') - self.device.mkdir(self.remote_profile, parents=True) - profile = Profile() - self.device.push(profile.profile, self.remote_profile) - self.log.debug("profile %s -> %s" % - (str(profile.profile), str(self.remote_profile))) - - def installed(self): - """ - geckoview_example installed - """ - if not self.device.is_app_installed(self.appname): - return (False, "%s not installed" % self.appname) - return (True, "%s installed" % self.appname) - - def start(self): - """ - geckoview_example starts - """ - try: - self.device.stop_application(self.appname) - self.device.clear_logcat() - - args = ["-profile", self.remote_profile] - env = {} - env["MOZ_CRASHREPORTER"] = "1" - env["MOZ_CRASHREPORTER_NO_REPORT"] = "1" - env["MOZ_CRASHREPORTER_SHUTDOWN"] = "1" - env["XPCOM_DEBUG_BREAK"] = "stack" - env["DISABLE_UNSAFE_CPOW_WARNINGS"] = "1" - env["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1" - env["MOZ_IN_AUTOMATION"] = "1" - env["R_LOG_VERBOSE"] = "1" - env["R_LOG_LEVEL"] = "6" - env["R_LOG_DESTINATION"] = "stderr" - self.device.launch_activity("org.mozilla.geckoview_example", - "GeckoViewActivity", - extra_args=args, moz_env=env) - except Exception: - return (False, "Exception during %s startup" % self.appname) - return (True, "%s started" % self.appname) - - def started(self): - """ - startup logcat messages - """ - expected = [ - "zerdatime", - "Displayed %s/.GeckoViewActivity" % self.appname - ] - # wait up to 60 seconds for startup - for wait_time in xrange(60): - time.sleep(1) - self.logcat = self.device.get_logcat() - for line in self.logcat: - for e in expected: - if e in line: - self.log.debug(line.strip()) - expected.remove(e) - if len(expected) == 0: - return (True, "All expected logcat messages found") - for e in expected: - self.log.error("missing from logcat: '%s'" % e) - return (False, "'%s' not found in logcat" % expected[0]) - - def run_tests(self): - """ - Run simple tests to verify that the geckoview_example app starts. - """ - all_tests = [self.installed, self.start, self.started] - self.log.suite_start(all_tests) - pass_count = 0 - fail_count = 0 - for test in all_tests: - self.test_name = test.__doc__.strip() - self.log.test_start(self.test_name) - - expected = 'PASS' - (passed, message) = test() - if passed: - pass_count += 1 - else: - fail_count += 1 - status = 'PASS' if passed else 'FAIL' - - self.log.test_end(self.test_name, status, expected, message) - - crashed = self.check_for_crashes() - if crashed: - fail_count = 1 - else: - self.log.info("Passed: %d" % pass_count) - self.log.info("Failed: %d" % fail_count) - self.log.suite_end() - - return 1 if fail_count else 0 - - def check_for_crashes(self): - if self.logcat: - if mozcrash.check_for_java_exception(self.logcat, self.test_name): - return True - symbols_path = self.options.symbols_path - try: - dump_dir = tempfile.mkdtemp() - remote_dir = posixpath.join(self.remote_profile, 'minidumps') - crash_dir_found = False - # wait up to 60 seconds for gecko startup to progress through - # crashreporter initialization, in case all tests finished quickly - for wait_time in xrange(60): - time.sleep(1) - if self.device.is_dir(remote_dir): - crash_dir_found = True - break - if not crash_dir_found: - # If crash reporting is enabled (MOZ_CRASHREPORTER=1), the - # minidumps directory is automatically created when the app - # (first) starts, so its lack of presence is a hint that - # something went wrong. - print "Automation Error: No crash directory (%s) found on remote device" % \ - remote_dir - # Whilst no crash was found, the run should still display as a failure - return True - self.device.pull(remote_dir, dump_dir) - crashed = mozcrash.log_crashes(self.log, dump_dir, symbols_path, test=self.test_name) - finally: - try: - shutil.rmtree(dump_dir) - except Exception: - self.log.warning("unable to remove directory: %s" % dump_dir) - return crashed - - def cleanup(self): - """ - Cleanup at end of job run. - """ - self.log.debug("Cleaning up...") - self.device.stop_application(self.appname) - self.device.rm(self.remote_profile, force=True, recursive=True) - self.log.debug("Cleanup complete.") - - -def run_test_harness(log, parser, options): - runner = GeckoviewTestRunner(log, options) - result = -1 - try: - result = runner.run_tests() - except KeyboardInterrupt: - log.info("rungeckoview.py | Received keyboard interrupt") - result = -1 - except Exception: - traceback.print_exc() - log.error( - "rungeckoview.py | Received unexpected exception while running tests") - result = 1 - finally: - try: - runner.cleanup() - except Exception: - # ignore device error while cleaning up - traceback.print_exc() - return result - - -def main(args=sys.argv[1:]): - parser = GeckoviewOptions() - mozlog.commandline.add_logging_group(parser) - options, args = parser.parse_args() - if args: - print >>sys.stderr, """Usage: %s""" % sys.argv[0] - sys.exit(1) - log = mozlog.commandline.setup_logging("rungeckoview", options, - {"tbpl": sys.stdout}) - return run_test_harness(log, parser, options) - - -if __name__ == "__main__": - sys.exit(main())
--- a/testing/mozharness/configs/android/android_common.py +++ b/testing/mozharness/configs/android/android_common.py @@ -318,25 +318,16 @@ config = { "--log-errorsummary=%(error_summary_file)s", "--log-tbpl-level=%(log_tbpl_level)s", "--symbols-path=%(symbols_path)s", "--startup-timeout=300", "--device=%(device_serial)s", "%(marionette_extra)s", ], }, - "geckoview": { - "run_filename": "rungeckoview.py", - "testsdir": "mochitest", - "options": [ - "--utility-path=%(utility_path)s", - "--symbols-path=%(symbols_path)s", - "--deviceSerial=%(device_serial)s", - ], - }, "geckoview-junit": { "run_filename": "runjunit.py", "testsdir": "mochitest", "options": [ "--certificate-path=%(certs_path)s", "--remote-webserver=%(remote_webserver)s", "--symbols-path=%(symbols_path)s", "--utility-path=%(utility_path)s",