Bug 1388883 - Ensure a fresh necko cache for each mochitest and reftest run; r=bc

This commit is contained in:
Geoff Brown 2017-08-16 06:55:49 -06:00
Родитель 847ee6ab9d
Коммит f735ed7396
2 изменённых файлов: 11 добавлений и 1 удалений

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

@ -154,6 +154,7 @@ class RemoteReftest(RefTest):
self.remoteProfile = options.remoteProfile
self.remoteTestRoot = options.remoteTestRoot
self.remoteLogFile = options.remoteLogFile
self.remoteCache = os.path.join(options.remoteTestRoot, "cache/")
self.localLogName = options.localLogName
self.pidFile = options.pidFile
if self.automation.IS_DEBUG_BUILD:
@ -162,6 +163,7 @@ class RemoteReftest(RefTest):
self.SERVER_STARTUP_TIMEOUT = 90
self.automation.deleteANRs()
self.automation.deleteTombstones()
self._devicemanager.removeDir(self.remoteCache)
self._populate_logger(options)
outputHandler = OutputHandler(self.log, options.utilityPath, options.symbolsPath)
@ -252,6 +254,8 @@ class RemoteReftest(RefTest):
prefs["browser.firstrun.show.localepicker"] = False
prefs["reftest.remote"] = True
prefs["datareporting.policy.dataSubmissionPolicyBypassAcceptance"] = True
# move necko cache to a location that can be cleaned up
prefs["browser.cache.disk.parent_directory"] = self.remoteCache
prefs["layout.css.devPixelsPerPx"] = "1.0"
# Because Fennec is a little wacky (see bug 1156817) we need to load the
@ -332,6 +336,7 @@ class RemoteReftest(RefTest):
print "WARNING: Unable to retrieve log file (%s) from remote " \
"device" % self.remoteLogFile
self._devicemanager.removeDir(self.remoteProfile)
self._devicemanager.removeDir(self.remoteCache)
self._devicemanager.removeDir(self.remoteTestRoot)
RefTest.cleanup(self, profileDir)
if (self.pidFile != ""):

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

@ -36,6 +36,7 @@ class MochiRemote(MochitestDesktop):
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
@ -51,6 +52,9 @@ class MochiRemote(MochitestDesktop):
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 cleanup(self, options):
if self._dm.fileExists(self.remoteLog):
@ -60,8 +64,9 @@ class MochiRemote(MochitestDesktop):
self.log.warning(
"Unable to retrieve log file (%s) from remote device" %
self.remoteLog)
self._dm.removeDir(self.remoteProfile)
self._dm.removeDir(self.remoteChromeTestDir)
self._dm.removeDir(self.remoteProfile)
self._dm.removeDir(self.remoteCache)
blobberUploadDir = os.environ.get('MOZ_UPLOAD_DIR', None)
if blobberUploadDir:
self._dm.getDirectory(self.remoteMozLog, blobberUploadDir)