def publishToFlixCheck2(self, comment, assetName, toShotgun, branch, asStills): log("## publishToFlixCheck:") publishSettings = checkUtils.readPublishSettings(self.fromEditorial.testInfo, assetName) timeout = publishSettings["timeout"] checkUtils.popupCheck(self.fromEditorial.testInfo, timeout, methodName="publishToFlixCheck") # Check the audio was created checkUtils.newAudioFile(self.fromEditorial.testInfo, methodName="publishToFlixCheck") # Update self.fromEditorial.testInfo if branch != "main": self.fromEditorial.testInfo.currentBranch = branch self.fromEditorial.testInfo.incrementEditVersion() # Check the editorial branch was created, the shotEdit is there and it's got the comment if not self.__checkShotEdit(comment): return 0 self.__checkMarkers(publishSettings["markers"]) self.__checkDuration(publishSettings["duration"]) self.__checkNPanels( publishSettings["stillRefs"] + publishSettings["animatedRefs"] + publishSettings["existing"] ) self.__checkPanels(publishSettings["stillRefs"], publishSettings["animatedRefs"], publishSettings["existing"]) log("All checks performed for publishToFlix.") return 1
def exportPdfCheck(self, panelsPerPage): log('## exportPdfCheck') # Assuming 5sec + 1sec/panel is enough to generate the PDF timeout = 5 + self.export.testInfo.getNumberPanelsFromShotEdit() pdfFile = "%s/%s_%s_%s_%s_%s.pdf" % (self.export.pdfDir, self.export.testInfo.show, self.export.testInfo.sequence, self.export.testInfo.getEditVersion(), self.export.testInfo.currentBranch, panelsPerPage) sikuli.wait(timeout) if not os.path.exists(pdfFile): self.export.testInfo.failed('exportPdfCheck: PDF was not generated in %s.' % self.export.pdfDir) else: log('- Found generated PDF.') sikuliUtils.closeChromeTab() if not checkUtils.popupCheck(self.export.testInfo, 5, "exportPdfCheck"): self.export.testInfo.failed('exportPdfCheck: Plugin failed, ' 'check log for errors. Exiting current checks...') log('All checks performed for exportPdf.')
def exportQuickTimeCheck(self, timeout): log('## exportQuickTimeCheck') if not checkUtils.popupCheck(self.export.testInfo, timeout, 'exportQuickTimeCheck'): self.export.testInfo.failed('exportQuickTimeCheck: Plugin failed, ' 'check log for errors. Exiting current checks...') return # movieFile = pyUtils.waitForFile(self.export.fleMovDir, '*.mov', 5) movieFile = "%s/%s_%s_v%s.mov" % (self.export.fleMovDir, self.export.testInfo.sequence, self.export.testInfo.currentBranch, self.export.testInfo.getEditVersion()) if not os.path.exists(movieFile): self.export.testInfo.failed('exportQuickTimeCheck: Movie was not generated in %s.' % self.export.fleMovDir) else: log('- Found generated movie.') movieSize = os.path.getsize(movieFile) if movieSize < 100: self.export.testInfo.failed('exportQuickTimeCheck: Movie created is less than 100 bytes, ' 'probably failed to be created.\nFilesize: %s' % movieSize) else: log('- Generated movie is not 0 bytes.') log('All checks performed for exportQuickTime.')
def exportPanelsCheck(self, settings): log('## exportPanelsCheck') # Using 2 sec per panel should be enough? timeout = len(settings['panels'])*2 if not checkUtils.popupCheck(self.export.testInfo, timeout, 'exportPanelsCheck'): self.export.testInfo.failed('exportPanelsCheck: Plugin failed, ' 'check log for errors. Exiting current checks...') return outputPath = '%s/%ss/' % (self.export.testInfo.outDir, settings['format']) # check panels have been exported to output directory if settings['format'] == 'jpeg': ext = 'jpg' elif settings['format'] == 'psd': ext = 'psd' exported = pyUtils.countFiles(outputPath, '%s_%s_*.%s' % (self.export.testInfo.show, self.export.testInfo.sequence, ext)) if not exported == len(settings['panels']): self.export.testInfo.failed( 'exportPanelsCheck: Not the right number of %ss ' 'have been exported. Expected %s, found %s instead.' % (ext, len(settings['panels']), exported)) else: log('- Found all expected %ss.' % ext) log('All checks performed for exportPanels.')
def __waitPopup(self): # Wait for the OK popup timeout = self.settings['timeout'] if not checkUtils.popupCheck(self.fromSbp.testInfo, timeout, 'sbpToFlixCheck'): self.fromSbp.testInfo.failed('sbpToFlixCheck: Plugin failed,' ' check log for errors. Exiting current checks...') return 0 return 1
def __waitPopup(self, timeout, methodName): startTime = time.time() # Wait for the OK popup if not checkUtils.popupCheck(self.toEditorial.testInfo, timeout, methodName): self.toEditorial.testInfo.failed('%s: No popup after %s sec, ' 'check log for errors. Exiting current checks...' % (methodName, timeout)) return 0 log("%s: Found popup after %ssec (timeout was %ssec)." % (methodName, int(time.time()-startTime), timeout)) return 1
def toShotgunCheck(self, timeout): """ Checks the publish to Shotgun was successful :param timeout: Time in sec before assuming the publish failed if there was no popup :return: None """ log('## toShotgunCheck') if not checkUtils.popupCheck(self.toEditorial.testInfo, timeout, 'toShotgunCheck'): self.toEditorial.testInfo.failed('toShotgunCheck: Plugin failed, ' 'check log for errors. Exiting current checks...') return # n movies were created under fleMov, where n is the number of markers in the published edit fleMovDir = '%s/fleMov' % self.toEditorial.editorialDir # TODO: handle cases where there's no marker in the edit for shot in self.toEditorial.testInfo.editMarkers: log('looking at shot %s' % shot, 'debug') shotDir = '%s/%s/' % (fleMovDir, shot) shotMov = '%s%s_%s_v%s.mov' % (shotDir, self.toEditorial.testInfo.sequence, shot, self.toEditorial.testInfo.getEditVersion()) log('toShotgunCheck: shotMov: %s' % shotMov, 'debug') if not os.path.exists(shotMov): self.toEditorial.testInfo.failed('toShotgunCheck: Could not find movie for shot %s' % shot) else: log('- Found movie for %s' % shot) movieSize = os.path.getsize(shotMov) if movieSize < 100: self.toEditorial.testInfo.failed('toShotgunCheck: Movie created ' 'is less than 100 bytes (Filesize: %s), ' 'probably failed to be created.' % movieSize) else: log('- Generated movie is not 0 bytes.') # Shotgun directory exists and contains .json file for published edit if not os.path.exists(self.toEditorial.sgDir): self.toEditorial.testInfo.failed('toShotgunCheck: shotgun/published directory ' 'was not created in the sequence directory.') else: log('- Found shotgun/published directory.') jsonFile = '%s%s_%s_%s.json' % (self.toEditorial.sgDir, self.toEditorial.testInfo.show, self.toEditorial.testInfo.sequence, self.toEditorial.testInfo.getEditVersion()) if not os.path.exists(jsonFile): self.toEditorial.testInfo.failed('toShotgunCheck: json file was not created in the shotgun directory.') else: log('- Found the json file in the shotgun directory.') log('All checks performed for toShotgun.')