def __init__(self, type, priority): super(childTask, self).__init__(type, priority) if globalProperty.isMachineOutOfChina(): self.PSFLocation = self._dbutil.getAppInfo("psf_path_us") self.testFilesLocation = self._dbutil.getAppInfo("psf_test_file_us") else: self.PSFLocation = self._dbutil.getAppInfo("psf_path") self.testFilesLocation = self._dbutil.getAppInfo("psf_test_file") self.PSFRepository = os.path.join(os.getcwd(), "PSFLocal") cwd = os.getcwd() if os.name == "posix": self.PSFLocalHome = cwd.split("QMSClient")[0] elif os.name == "nt": self.PSFLocalHome = cwd[0:3] self.PSFLogBackUpDir = os.path.join(os.getcwd(), "PSFLogBak") self.PSFConfig = "psConfig.js" self.launcherFileName = "MyPsfLauncher" self.launcherFilePath = None self.buildNum = "" self.localTestFileLocation = "" self.localConfigFileLocation = "" self.downloadFileFlag = "1" self.setupFileFlag = "Yes" self.userHome = globalProperty.getUserHome() if os.name == "posix": self.platform = "osx10" # Need to add this to enable access for assistive devices self.runCommand("sudo touch /private/var/db/.AccessibilityAPIEnabled") if os.name == "nt": self.platform = "win32" return
def run(self): self.logger.info('Starting PSF log parsing') self.userHome = globalProperty.getUserHome() if 'PSFHome' in self.parameter: self.psfHome = self.parameter['PSFHome'] else: self.psfHome = os.path.join(self.userHome, 'PSF') if not os.path.exists(self.psfHome): print("There is no PSF installed in [%s]" % self.psfHome) raise ("There is no PSF installed in [%s]" % self.psfHome) self.psfLogHome = os.path.join(self.psfHome, 'logs') self.walkLogFiles(self.psfLogHome, self.doXmlParsing) self.prepareFolderHierarchy() #self.output() self.writeHtmlReport() self.uploadReport()