|
|
@ -15,14 +15,7 @@ import re |
|
|
|
|
|
|
|
import basic.program |
|
|
|
import basic.constants as B |
|
|
|
import collect_testcase |
|
|
|
import compare_testcase |
|
|
|
import copy_appdummy |
|
|
|
import execute_testcase |
|
|
|
import finish_testsuite |
|
|
|
import init_testcase |
|
|
|
import init_testsuite |
|
|
|
import test_executer |
|
|
|
import utils.job_tool |
|
|
|
import utils.file_tool |
|
|
|
import utils.data_const as D |
|
|
|
import utils.date_tool |
|
|
@ -46,7 +39,6 @@ DLG_CONTINUE = "fortsetzen" |
|
|
|
DLG_DUMMY_STEP = "Dummy-Schritt" |
|
|
|
DLG_NEWJOB = "neuer Job" |
|
|
|
|
|
|
|
JSON_FILE = "actualJob.json" |
|
|
|
JOB_NR = { |
|
|
|
DLG_TESTSUITE : { |
|
|
|
"start": "init_testsuite", |
|
|
@ -162,7 +154,7 @@ def restartActualProcess(job): |
|
|
|
check if an actual process is open |
|
|
|
:return: |
|
|
|
""" |
|
|
|
path = os.path.join(job.conf.confs[B.SUBJECT_PATH][B.ATTR_PATH_DEBUG], JSON_FILE) |
|
|
|
path = utils.path_tool.getActualJsonPath(job) |
|
|
|
if os.path.exists(path): |
|
|
|
actProc = utils.file_tool.readFileDict(job, path, job.m) |
|
|
|
print("restartActJob "+str(actProc)) |
|
|
@ -173,7 +165,8 @@ def restartActualProcess(job): |
|
|
|
dialogProcess(job) |
|
|
|
else: |
|
|
|
actProc["step"] = str(step+1) |
|
|
|
startProcess(job, actProc) |
|
|
|
utils.job_tool.startProcess(job, actProc) |
|
|
|
restartActualProcess(job) |
|
|
|
selection = [DLG_NEWJOB, DLG_REDO] |
|
|
|
|
|
|
|
nr = int(JOB_NR[actProc["gran"]][actProc["program"]]["jobnr"]) |
|
|
@ -184,10 +177,12 @@ def restartActualProcess(job): |
|
|
|
choice = getChoice(job, selection, DLG_ENVIRONMENT) |
|
|
|
print(choice) |
|
|
|
if choice == DLG_REDO: |
|
|
|
startProcess(job, actProc) |
|
|
|
utils.job_tool.startProcess(job, actProc) |
|
|
|
restartActualProcess(job) |
|
|
|
elif choice == DLG_DUMMY_STEP: |
|
|
|
actProc["program"] = JOB_LIST[nr+1] |
|
|
|
startProcess(job, actProc) |
|
|
|
utils.job_tool.startProcess(job, actProc) |
|
|
|
restartActualProcess(job) |
|
|
|
elif choice == DLG_CONTINUE: |
|
|
|
if nr == 7: |
|
|
|
nr = 9 |
|
|
@ -196,7 +191,7 @@ def restartActualProcess(job): |
|
|
|
print (" act nr "+str(nr)) |
|
|
|
actProc["step"] = str(step + 1) |
|
|
|
actProc["program"] = JOB_LIST[nr] |
|
|
|
startProcess(job, actProc) |
|
|
|
utils.job_tool.startProcess(job, actProc) |
|
|
|
elif choice == DLG_NEWJOB: |
|
|
|
dialogProcess(job) |
|
|
|
else: |
|
|
@ -254,7 +249,8 @@ def dialogProcess(job): |
|
|
|
setattr(job.par, B.PAR_TSTIME, utils.date_tool.getActdate(utils.date_tool.F_DIR)) |
|
|
|
path = utils.path_tool.composePattern(job, "{"+P.P_TSBASE+"}", None) |
|
|
|
process[B.PAR_TSDIR] = path |
|
|
|
startProcess(job, process) |
|
|
|
utils.job_tool.startProcess(job, process) |
|
|
|
restartActualProcess(job) |
|
|
|
|
|
|
|
def getChoice(job, choiselist, description): |
|
|
|
index = 0 |
|
|
@ -277,45 +273,6 @@ def getChoice(job, choiselist, description): |
|
|
|
return choiselist[int(choice) - 1] |
|
|
|
|
|
|
|
|
|
|
|
def startProcess(job, process): |
|
|
|
print(str(process)) |
|
|
|
path = os.path.join(job.conf.confs[B.SUBJECT_PATH][B.ATTR_PATH_DEBUG], JSON_FILE) |
|
|
|
utils.file_tool.writeFileDict(job.m, job, path, process) |
|
|
|
jobargs = {} |
|
|
|
jobargs[B.PAR_APP] = process["app"] |
|
|
|
jobargs[B.PAR_ENV] = process["env"] |
|
|
|
if B.PAR_STEP in process: |
|
|
|
jobargs[B.PAR_STEP] = process[B.PAR_STEP] |
|
|
|
if B.PAR_TCDIR in process: |
|
|
|
jobargs[B.PAR_TCDIR] = process[B.PAR_TCDIR] |
|
|
|
jobargs[B.PAR_TESTCASE] = process["entity"] |
|
|
|
elif B.PAR_TSDIR in process: |
|
|
|
jobargs[B.PAR_TSDIR] = process[B.PAR_TSDIR] |
|
|
|
jobargs[B.PAR_TESTSUITE] = process["entity"] |
|
|
|
print("process-programm "+process["program"]) |
|
|
|
myjob = basic.program.Job(process["program"], jobargs) |
|
|
|
myjob.startJob() |
|
|
|
if process["program"] == "init_testcase": |
|
|
|
init_testcase.startPyJob(myjob) |
|
|
|
elif process["program"] == "execute_testcase": |
|
|
|
execute_testcase.startPyJob(myjob) |
|
|
|
elif process["program"] == "collect_testcase": |
|
|
|
collect_testcase.startPyJob(myjob) |
|
|
|
elif process["program"] == "compare_testcase": |
|
|
|
compare_testcase.startPyJob(myjob) |
|
|
|
elif process["program"] == "copy_appdummy": |
|
|
|
copy_appdummy.startPyJob(myjob) |
|
|
|
elif process["program"] == "init_testsuite": |
|
|
|
init_testsuite.startPyJob(myjob) |
|
|
|
elif process["program"] == "execute_testsuite": |
|
|
|
print("execute_testsuite.startPyJob(myjob) not implemented") |
|
|
|
elif process["program"] == "collect_testsuite": |
|
|
|
print("collect_testsuite.startPyJob(myjob) not implemented") |
|
|
|
elif process["program"] == "finish_testsuite": |
|
|
|
finish_testsuite.startPyJob(myjob) |
|
|
|
elif process["program"] == "test_executer": |
|
|
|
test_executer.startPyJob(myjob) |
|
|
|
restartActualProcess(job) |
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
job = basic.program.Job(PROGRAM_NAME, {}) |
|
|
|