# This is a sample Python script. import os.path import sys# # import jsonpickle # pip install jsonpickle import basic.program as program import basic.componentHandling import utils.file_tool import utils.path_tool import utils.report_tool import utils.zip_tool # Press Umschalt+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. PROGRAM_NAME = "finish_testsuite" def startPyJob(job): cm = basic.componentHandling(job) report = utils.report_tool.Report() testinstances = {} if hasattr(job.par, "testinstances"): testinstances = getattr(job.par, "testinstances") for tc in testinstances: path = os.path.join(testinstances[tc], "Result.html") text = utils.file_tool.readFileText(job, path, job.m) report.extractTestcase(tc, text) text = report.reportTestsuite() path = os.path.join(job.par.tsdir, "Result.html") utils.file_tool.writeFileText(job.m, job, path, text) archivFolder = job.conf.confs["paths"]["archiv"] tsFolder = os.path.join(archivFolder, "Testlauf") tarfile = utils.zip_tool.openNewTarFile(job, tsFolder, job.par.usecase+"_"+job.par.tstime+".tar.gz") utils.zip_tool.appendFolderIntoTarFile(job, tsFolder, job.par.usecase+"_"+job.par.tstime, tarfile) for tc in testinstances: tcSubFolder = testinstances[tc][len(archivFolder)+1:] utils.zip_tool.appendFolderIntoTarFile(archivFolder, tcSubFolder, tarfile) tarfile.close() pass # Press the green button in the gutter to run the script. if __name__ == '__main__': x = program.Job("check_environment") #m = message.Message(3) #m.closeMessage() x.startJob() x.m.logInfo("hier eine LogInfo") x.m.logDebug("hier eine DbugMeldung") x.m.logDebug(str(vars(x.par)) + "\n" + str(vars(x.conf))) if x.m.isRc("fatal"): x.stopJob() exit(x.m.rc * (-1) + 3) startPyJob(x) x.stopJob() # See PyCharm help at https://www.jetbrains.com/help/pycharm/