def __init__(self, automation, devmgr, options): MochitestDesktop.__init__(self, options.flavor, vars(options)) self._automation = automation self._dm = devmgr self.chromePushed = False self.environment = self._automation.environment self.remoteProfile = os.path.join(options.remoteTestRoot, "profile/") self.remoteModulesDir = os.path.join(options.remoteTestRoot, "modules/") self.remoteCache = os.path.join(options.remoteTestRoot, "cache/") self._automation.setRemoteProfile(self.remoteProfile) self.remoteLog = options.remoteLogFile self.localLog = options.logFile self._automation.deleteANRs() self._automation.deleteTombstones() self.certdbNew = True self.remoteMozLog = os.path.join(options.remoteTestRoot, "mozlog") self._dm.removeDir(self.remoteMozLog) self._dm.mkDir(self.remoteMozLog) self.remoteChromeTestDir = os.path.join( options.remoteTestRoot, "chrome") self._dm.removeDir(self.remoteChromeTestDir) self._dm.mkDir(self.remoteChromeTestDir) self._dm.removeDir(self.remoteProfile) self._dm.removeDir(self.remoteCache) # move necko cache to a location that can be cleaned up options.extraPrefs += ["browser.cache.disk.parent_directory=%s" % self.remoteCache]
def __init__(self, automation, devmgr, options): """ Simple one-time initialization. """ MochitestDesktop.__init__(self, options.flavor, vars(options)) self.auto = automation self.dm = devmgr self.dm.default_timeout = 320 self.options = options self.options.logFile = "robocop.log" self.environment = self.auto.environment self.deviceRoot = self.dm.getDeviceRoot() self.remoteProfile = options.remoteTestRoot + "/profile" self.remoteProfileCopy = options.remoteTestRoot + "/profile-copy" self.auto.setRemoteProfile(self.remoteProfile) self.remoteConfigFile = os.path.join(self.deviceRoot, "robotium.config") self.remoteLog = options.remoteLogFile self.auto.setRemoteLog(self.remoteLog) self.remoteScreenshots = "/mnt/sdcard/Robotium-Screenshots" self.remoteMozLog = os.path.join(options.remoteTestRoot, "mozlog") self.auto.setServerInfo(self.options.webServer, self.options.httpPort, self.options.sslPort) self.localLog = options.logFile self.localProfile = None self.auto.setAppName(self.options.remoteappname) self.certdbNew = True self.remoteCopyAvailable = True self.passed = 0 self.failed = 0 self.todo = 0
def __init__(self, automation, devmgr, options): MochitestDesktop.__init__(self, options.flavor, vars(options)) self._automation = automation self._dm = devmgr self.environment = self._automation.environment self.remoteProfile = os.path.join(options.remoteTestRoot, "profile/") self.remoteModulesDir = os.path.join(options.remoteTestRoot, "modules/") self.remoteCache = os.path.join(options.remoteTestRoot, "cache/") self._automation.setRemoteProfile(self.remoteProfile) self.remoteLog = options.remoteLogFile self.localLog = options.logFile self._automation.deleteANRs() self._automation.deleteTombstones() self.certdbNew = True self.remoteMozLog = os.path.join(options.remoteTestRoot, "mozlog") self._dm.removeDir(self.remoteMozLog) self._dm.mkDir(self.remoteMozLog) self.remoteChromeTestDir = os.path.join( options.remoteTestRoot, "chrome") self._dm.removeDir(self.remoteChromeTestDir) self._dm.mkDir(self.remoteChromeTestDir) self._dm.removeDir(self.remoteProfile) self._dm.removeDir(self.remoteCache) # move necko cache to a location that can be cleaned up options.extraPrefs += ["browser.cache.disk.parent_directory=%s" % self.remoteCache]
def __init__(self, options, message_logger): """ Simple one-time initialization. """ MochitestDesktop.__init__(self, options.flavor, vars(options)) verbose = False if options.log_tbpl_level == 'debug' or options.log_mach_level == 'debug': verbose = True self.device = ADBDevice(adb=options.adbPath or 'adb', device=options.deviceSerial, test_root=options.remoteTestRoot, verbose=verbose) # Check that Firefox is installed expected = options.app.split('/')[-1] if not self.device.is_app_installed(expected): raise Exception("%s is not installed on this device" % expected) options.logFile = "robocop.log" if options.remoteTestRoot is None: options.remoteTestRoot = self.device.test_root self.remoteProfile = posixpath.join(options.remoteTestRoot, "profile") self.remoteProfileCopy = posixpath.join(options.remoteTestRoot, "profile-copy") self.remoteModulesDir = posixpath.join(options.remoteTestRoot, "modules/") self.remoteConfigFile = posixpath.join(options.remoteTestRoot, "robotium.config") self.remoteLogFile = posixpath.join(options.remoteTestRoot, "logs", "robocop.log") self.options = options process_args = {'messageLogger': message_logger} self.auto = RemoteAutomation(self.device, options.remoteappname, self.remoteProfile, self.remoteLogFile, processArgs=process_args) self.environment = self.auto.environment self.remoteScreenshots = "/mnt/sdcard/Robotium-Screenshots" self.remoteMozLog = posixpath.join(options.remoteTestRoot, "mozlog") self.localLog = options.logFile self.localProfile = None self.certdbNew = True self.passed = 0 self.failed = 0 self.todo = 0
def __init__(self, automation, devmgr, options): MochitestDesktop.__init__(self, options) self._automation = automation self._dm = devmgr self.environment = self._automation.environment self.remoteProfile = os.path.join(options.remoteTestRoot, "profile/") self.remoteModulesDir = os.path.join(options.remoteTestRoot, "modules/") self._automation.setRemoteProfile(self.remoteProfile) self.remoteLog = options.remoteLogFile self.localLog = options.logFile self._automation.deleteANRs() self._automation.deleteTombstones() self.certdbNew = True self.remoteMozLog = os.path.join(options.remoteTestRoot, "mozlog") self._dm.removeDir(self.remoteMozLog) self._dm.mkDir(self.remoteMozLog) self.remoteChromeTestDir = os.path.join(options.remoteTestRoot, "chrome") self._dm.removeDir(self.remoteChromeTestDir) self._dm.mkDir(self.remoteChromeTestDir)
def __init__(self, automation, devmgr, options): MochitestDesktop.__init__(self, options) self._automation = automation self._dm = devmgr self.environment = self._automation.environment self.remoteProfile = options.remoteTestRoot + "/profile" self._automation.setRemoteProfile(self.remoteProfile) self.remoteLog = options.remoteLogFile self.localLog = options.logFile self._automation.deleteANRs() self._automation.deleteTombstones() self.certdbNew = True self.remoteNSPR = os.path.join(options.remoteTestRoot, "nspr") self._dm.removeDir(self.remoteNSPR) self._dm.mkDir(self.remoteNSPR) self.remoteChromeTestDir = os.path.join( options.remoteTestRoot, "chrome") self._dm.removeDir(self.remoteChromeTestDir) self._dm.mkDir(self.remoteChromeTestDir)
def __init__(self, automation, devmgr, options): """ Simple one-time initialization. """ MochitestDesktop.__init__(self, options) self.auto = automation self.dm = devmgr self.dm.default_timeout = 320 self.options = options self.options.logFile = "robocop.log" self.environment = self.auto.environment self.deviceRoot = self.dm.getDeviceRoot() self.remoteProfile = options.remoteTestRoot + "/profile" self.remoteProfileCopy = options.remoteTestRoot + "/profile-copy" self.auto.setRemoteProfile(self.remoteProfile) self.remoteConfigFile = os.path.join( self.deviceRoot, "robotium.config") self.remoteLog = options.remoteLogFile self.auto.setRemoteLog(self.remoteLog) self.remoteScreenshots = "/mnt/sdcard/Robotium-Screenshots" self.remoteMozLog = os.path.join(options.remoteTestRoot, "mozlog") self.auto.setServerInfo( self.options.webServer, self.options.httpPort, self.options.sslPort) self.localLog = options.logFile self.localProfile = None productPieces = self.options.remoteProductName.split('.') if (productPieces is not None): self.auto.setProduct(productPieces[0]) else: self.auto.setProduct(self.options.remoteProductName) self.auto.setAppName(self.options.remoteappname) self.certdbNew = True self.remoteCopyAvailable = True self.passed = 0 self.failed = 0 self.todo = 0
def __init__(self, options): MochitestDesktop.__init__(self, options.flavor, vars(options)) verbose = False if options.log_tbpl_level == 'debug' or options.log_mach_level == 'debug': verbose = True if hasattr(options, 'log'): delattr(options, 'log') self.certdbNew = True self.chromePushed = False self.mozLogName = "moz.log" self.device = ADBDevice(adb=options.adbPath or 'adb', device=options.deviceSerial, test_root=options.remoteTestRoot, verbose=verbose) if options.remoteTestRoot is None: options.remoteTestRoot = self.device.test_root options.dumpOutputDirectory = options.remoteTestRoot self.remoteLogFile = posixpath.join(options.remoteTestRoot, "logs", "mochitest.log") logParent = posixpath.dirname(self.remoteLogFile) self.device.rm(logParent, force=True, recursive=True) self.device.mkdir(logParent) self.remoteProfile = posixpath.join(options.remoteTestRoot, "profile/") self.device.rm(self.remoteProfile, force=True, recursive=True) self.counts = dict() self.message_logger = MessageLogger(logger=None) self.message_logger.logger = self.log process_args = {'messageLogger': self.message_logger, 'counts': self.counts} self.automation = RemoteAutomation(self.device, options.remoteappname, self.remoteProfile, self.remoteLogFile, processArgs=process_args) self.environment = self.automation.environment # Check that Firefox is installed expected = options.app.split('/')[-1] if not self.device.is_app_installed(expected): raise Exception("%s is not installed on this device" % expected) self.automation.deleteANRs() self.automation.deleteTombstones() self.device.clear_logcat() self.remoteModulesDir = posixpath.join(options.remoteTestRoot, "modules/") self.remoteCache = posixpath.join(options.remoteTestRoot, "cache/") self.device.rm(self.remoteCache, force=True, recursive=True) # move necko cache to a location that can be cleaned up options.extraPrefs += ["browser.cache.disk.parent_directory=%s" % self.remoteCache] self.remoteMozLog = posixpath.join(options.remoteTestRoot, "mozlog") self.device.rm(self.remoteMozLog, force=True, recursive=True) self.device.mkdir(self.remoteMozLog) self.remoteChromeTestDir = posixpath.join( options.remoteTestRoot, "chrome") self.device.rm(self.remoteChromeTestDir, force=True, recursive=True) self.device.mkdir(self.remoteChromeTestDir) procName = options.app.split('/')[-1] self.device.stop_application(procName) if self.device.process_exist(procName): self.log.warning("unable to kill %s before running tests!" % procName) # Add Android version (SDK level) to mozinfo so that manifest entries # can be conditional on android_version. self.log.info( "Android sdk version '%s'; will use this to filter manifests" % str(self.device.version)) mozinfo.info['android_version'] = str(self.device.version) mozinfo.info['isFennec'] = not ('geckoview' in options.app) mozinfo.info['is_emulator'] = self.device._device_serial.startswith('emulator-')
def __init__(self, options): MochitestDesktop.__init__(self, options.flavor, vars(options)) verbose = False if (options.log_mach_verbose or options.log_tbpl_level == "debug" or options.log_mach_level == "debug" or options.log_raw_level == "debug"): verbose = True if hasattr(options, "log"): delattr(options, "log") self.certdbNew = True self.chromePushed = False expected = options.app.split("/")[-1] self.device = ADBDeviceFactory( adb=options.adbPath or "adb", device=options.deviceSerial, test_root=options.remoteTestRoot, verbose=verbose, run_as_package=expected, ) if options.remoteTestRoot is None: options.remoteTestRoot = self.device.test_root options.dumpOutputDirectory = options.remoteTestRoot self.remoteLogFile = posixpath.join(options.remoteTestRoot, "logs", "mochitest.log") logParent = posixpath.dirname(self.remoteLogFile) self.device.rm(logParent, force=True, recursive=True) self.device.mkdir(logParent, parents=True) self.remoteProfile = posixpath.join(options.remoteTestRoot, "profile") self.device.rm(self.remoteProfile, force=True, recursive=True) self.message_logger = MessageLogger(logger=None) self.message_logger.logger = self.log # Check that Firefox is installed expected = options.app.split("/")[-1] if not self.device.is_app_installed(expected): raise Exception("%s is not installed on this device" % expected) self.device.clear_logcat() self.remoteModulesDir = posixpath.join(options.remoteTestRoot, "modules/") self.remoteCache = posixpath.join(options.remoteTestRoot, "cache/") self.device.rm(self.remoteCache, force=True, recursive=True) # move necko cache to a location that can be cleaned up options.extraPrefs += [ "browser.cache.disk.parent_directory=%s" % self.remoteCache ] self.remoteMozLog = posixpath.join(options.remoteTestRoot, "mozlog") self.device.rm(self.remoteMozLog, force=True, recursive=True) self.device.mkdir(self.remoteMozLog, parents=True) self.remoteChromeTestDir = posixpath.join(options.remoteTestRoot, "chrome") self.device.rm(self.remoteChromeTestDir, force=True, recursive=True) self.device.mkdir(self.remoteChromeTestDir, parents=True) self.appName = options.remoteappname self.device.stop_application(self.appName) if self.device.process_exist(self.appName): self.log.warning("unable to kill %s before running tests!" % self.appName) # Add Android version (SDK level) to mozinfo so that manifest entries # can be conditional on android_version. self.log.info( "Android sdk version '%s'; will use this to filter manifests" % str(self.device.version)) mozinfo.info["android_version"] = str(self.device.version) mozinfo.info["is_fennec"] = not ("geckoview" in options.app) mozinfo.info["is_emulator"] = self.device._device_serial.startswith( "emulator-")