|
@ -26,6 +26,7 @@ import basic.constants as B |
|
|
import tools.job_tool as job_tool |
|
|
import tools.job_tool as job_tool |
|
|
import model.catalog |
|
|
import model.catalog |
|
|
import tools.job_const as J |
|
|
import tools.job_const as J |
|
|
|
|
|
import tools.step_tool |
|
|
|
|
|
|
|
|
PROGRAM_NAME = "start_dialog" |
|
|
PROGRAM_NAME = "start_dialog" |
|
|
JOB_PROC = "proc" |
|
|
JOB_PROC = "proc" |
|
@ -77,62 +78,75 @@ def getChoice(job, choiselist, description): |
|
|
if verbose: print("treffer "+str(choiselist)) |
|
|
if verbose: print("treffer "+str(choiselist)) |
|
|
return choiselist[int(choice) - 1] |
|
|
return choiselist[int(choice) - 1] |
|
|
|
|
|
|
|
|
def initDialog(job, args={}): |
|
|
def initDialog(job): |
|
|
""" |
|
|
""" |
|
|
dialog to initialize a child-process |
|
|
dialog to initialize a child-process |
|
|
:param job: |
|
|
:param job: |
|
|
:return: |
|
|
:return: |
|
|
""" |
|
|
""" |
|
|
# which process |
|
|
# which process |
|
|
|
|
|
args = {} |
|
|
verify = job.getDebugLevel("job_tool") |
|
|
verify = job.getDebugLevel("job_tool") |
|
|
if JOB_PROC not in args: |
|
|
if JOB_PROC not in args: |
|
|
args[JOB_PROC] = getChoice(job, J.LIST_PROC, "Welchen Prozess starten") |
|
|
args[JOB_PROC] = getChoice(job, J.LIST_PROC, "Welchen Prozess starten") |
|
|
args[J.MODEL_GRAN] = "" |
|
|
args[B.PAR_GRAN] = "" |
|
|
args[B.PAR_USER] = job_tool.getUser() |
|
|
args[B.PAR_USER] = job_tool.getUser() |
|
|
args[B.PAR_PROJ] = job_tool.getUserProject() |
|
|
args[B.PAR_PROJ] = job_tool.getUserProject() |
|
|
args[B.PAR_STEP] = "" |
|
|
args[B.PAR_STEP] = "" |
|
|
job.m.logTrace(verify, args[JOB_PROC]) |
|
|
job.m.logTrace(verify, args[JOB_PROC]) |
|
|
# """ |
|
|
# """ |
|
|
|
|
|
print("JOB_PROC "+args[JOB_PROC]) |
|
|
if args[JOB_PROC] == J.PROC_TP_EXECUTION: |
|
|
if args[JOB_PROC] == J.PROC_TP_EXECUTION: |
|
|
#args[J.MODEL_GRAN] = B.PAR_TESTPLAN |
|
|
args[B.PAR_GRAN] = B.PAR_TESTPLAN |
|
|
args[B.PAR_STEP] = "1" |
|
|
args[B.PAR_STEP] = tools.step_tool.getNextStepID(job, 0, "", args[B.PAR_GRAN]) |
|
|
args[B.PAR_PROGRAM] = J.PROG_TEST_EXECUTER |
|
|
args[B.PAR_PROGRAM] = J.PROG_TEST_EXECUTER |
|
|
elif args[JOB_PROC] in [J.PROC_TS_STEPWISE, J.PROC_TS_EXECUTION]: |
|
|
elif args[JOB_PROC] in [J.PROC_TS_STEPWISE, J.PROC_TS_EXECUTION]: |
|
|
#args[J.MODEL_GRAN] = B.PAR_TESTSUITE |
|
|
args[B.PAR_GRAN] = B.PAR_TESTSUITE |
|
|
args[B.PAR_STEP] = "1" |
|
|
args[B.PAR_STEP] = tools.step_tool.getNextStepID(job, 0, "", args[B.PAR_GRAN]) |
|
|
if args[JOB_PROC] == J.PROC_TS_EXECUTION: |
|
|
if args[JOB_PROC] == J.PROC_TS_EXECUTION: |
|
|
args[B.PAR_PROGRAM] = J.PROG_TEST_EXECUTER |
|
|
args[B.PAR_PROGRAM] = J.PROG_TEST_EXECUTER |
|
|
else: |
|
|
else: |
|
|
args[B.PAR_PROGRAM] = J.PROG_TS_INIT |
|
|
args[B.PAR_PROGRAM] = J.PROG_TS_INIT |
|
|
elif args[JOB_PROC] in [J.PROC_TC_STEPWISE, J.PROC_TC_EXECUTION]: |
|
|
# elif args[JOB_PROC] in [J.PROC_TC_STEPWISE, J.PROC_TC_EXECUTION]: |
|
|
#args[J.MODEL_GRAN] = B.PAR_TESTCASE |
|
|
elif args[JOB_PROC] == J.PROC_TC_EXECUTION: |
|
|
args[B.PAR_STEP] = "1" |
|
|
print("JOB_PROC - 111 " + args[JOB_PROC]) |
|
|
if args[JOB_PROC] == J.PROC_TC_EXECUTION: |
|
|
args[B.PAR_GRAN] = B.PAR_TESTCASE |
|
|
args[B.PAR_PROGRAM] = J.PROG_TEST_EXECUTER |
|
|
args[B.PAR_STEP] = tools.step_tool.getNextStepID(job, 0, "", args[B.PAR_GRAN]) |
|
|
else: |
|
|
args[B.PAR_PROGRAM] = J.PROG_TEST_EXECUTER |
|
|
args[B.PAR_PROGRAM] = J.PROG_TC_INIT |
|
|
elif args[JOB_PROC] == J.PROC_TC_STEPWISE: |
|
|
|
|
|
print("JOB_PROC - 116 " + args[JOB_PROC]) |
|
|
|
|
|
args[B.PAR_GRAN] = B.PAR_TESTCASE |
|
|
|
|
|
args[B.PAR_STEP] = tools.step_tool.getNextStepID(job, 0, "", args[B.PAR_GRAN]) |
|
|
|
|
|
args[B.PAR_PROGRAM] = J.PROG_TC_INIT |
|
|
elif args[JOB_PROC] == J.PROC_REDO_EXECUTION: |
|
|
elif args[JOB_PROC] == J.PROC_REDO_EXECUTION: |
|
|
args[B.PAR_PROGRAM] = getChoice(job, J.LIST_TS_PROGS + J.LIST_TC_PROGS, |
|
|
args[B.PAR_PROGRAM] = getChoice(job, J.LIST_TS_PROGS + J.LIST_TC_PROGS, |
|
|
"Welches Programm starten") |
|
|
"Welches Programm starten") |
|
|
elif args[JOB_PROC] == J.PROC_SINGLE_JOB: |
|
|
elif args[JOB_PROC] == J.PROC_SINGLE_JOB: |
|
|
args[B.PAR_PROGRAM] = getChoice(job, J.LIST_SERVICE_PROG, "Welches Programm starten") |
|
|
args[B.PAR_PROGRAM] = getChoice(job, J.LIST_SERVICE_PROG, "Welches Programm starten") |
|
|
else: |
|
|
else: |
|
|
args[J.MODEL_GRAN] = "" |
|
|
args[B.PAR_GRAN] = "" |
|
|
args[J.MODEL_GRAN] = "" |
|
|
# args[B.PAR_GRAN] = "" |
|
|
# """2 |
|
|
# """2 |
|
|
catalog = model.catalog.Catalog.getInstance() |
|
|
catalog = model.catalog.Catalog.getInstance() |
|
|
setattr(job.par, B.SUBJECT_PROJECT, "TESTPROJ") |
|
|
setattr(job.par, B.SUBJECT_PROJECT, "TESTPROJ") |
|
|
programDef = catalog.getValue(job, basic.program.CTLG_NAME, args[B.PAR_PROGRAM], "") |
|
|
programDef = catalog.getValue(job, basic.program.CTLG_NAME, args[B.PAR_PROGRAM], "") |
|
|
job.m.logTrace(verify, "programdefinition "+str(programDef)) |
|
|
job.m.logTrace(verify, "programdefinition "+str(programDef)) |
|
|
|
|
|
print("programdefinition "+str(programDef)) |
|
|
if verbose: print("programdefinition "+args[B.PAR_PROGRAM]+" "+str(programDef)) |
|
|
if verbose: print("programdefinition "+args[B.PAR_PROGRAM]+" "+str(programDef)) |
|
|
for p in programDef[basic.program.CTLG_PARDEF]: |
|
|
#for p in programDef[basic.program.CTLG_PARDEF]: |
|
|
job.m.logTrace(verify, "progCtlog "+p+":") |
|
|
print(str(args)) |
|
|
job.m.logTrace(verify, args) |
|
|
for p in [B.PAR_PROJ, B.PAR_GRAN, B.PAR_APP, J.ARG_TESTELEM, B.PAR_COMP, B.PAR_ENV, |
|
|
if verbose: print(" "+p+" "+str(args)) |
|
|
B.PAR_TESTPLAN, B.PAR_TESTSUITE, B.PAR_TESTCASE, |
|
|
|
|
|
B.PAR_TSTIME, B.PAR_TCTIME, B.PAR_TPTIME, B.PAR_VAR]: |
|
|
if p in args and len(args[p]) > 0: |
|
|
if p in args and len(args[p]) > 0: |
|
|
if verbose: print("arg: " + p+" "+args[p]) |
|
|
continue |
|
|
job.m.logDebug(verify, "progArg "+p+" ist "+args[p]) |
|
|
if p not in programDef[basic.program.CTLG_PARDEF]: |
|
|
elif programDef[basic.program.CTLG_PARDEF][p] == "args": |
|
|
continue |
|
|
|
|
|
if programDef[basic.program.CTLG_PARDEF][p] != "args": |
|
|
|
|
|
args[p] = programDef[basic.program.CTLG_PARDEF][p] |
|
|
|
|
|
continue |
|
|
|
|
|
print("+ bearbeite "+p) |
|
|
|
|
|
if programDef[basic.program.CTLG_PARDEF][p] == "args": |
|
|
description = "" |
|
|
description = "" |
|
|
job.m.logDebug(verify, "to select "+p) |
|
|
job.m.logDebug(verify, "to select "+p) |
|
|
if p == B.PAR_GRAN: |
|
|
if p == B.PAR_GRAN: |
|
@ -141,22 +155,21 @@ def initDialog(job, args={}): |
|
|
elif p == B.PAR_APP: |
|
|
elif p == B.PAR_APP: |
|
|
description = J.CHOICE_APP |
|
|
description = J.CHOICE_APP |
|
|
choiceList = job_tool.select_application(job, programDef, args[B.PAR_PROJ]) |
|
|
choiceList = job_tool.select_application(job, programDef, args[B.PAR_PROJ]) |
|
|
elif p == J.ARG_TESTELEM: |
|
|
elif p == B.PAR_TESTPLAN or p == J.ARG_TESTELEM and args[B.PAR_GRAN] in [J.GRAN_TP, B.PAR_TESTPLAN]: |
|
|
if verbose: print("testelem "+args[B.PAR_GRAN]) |
|
|
description = J.CHOICE_TP |
|
|
if args[B.PAR_GRAN] in [J.GRAN_TP, B.PAR_TESTPLAN]: |
|
|
choiceList = job_tool.select_testplan(job, programDef, args) |
|
|
description = J.CHOICE_TP |
|
|
p = B.PAR_TESTPLAN |
|
|
choiceList = job_tool.select_testplan(job, programDef, args) |
|
|
if J.ARG_TESTELEM in programDef[basic.program.CTLG_PARDEF]: args[J.ARG_TESTELEM] = p |
|
|
p = B.PAR_TESTPLAN |
|
|
elif p == B.PAR_TESTSUITE or p == J.ARG_TESTELEM and args[B.PAR_GRAN] in [J.GRAN_TS, B.PAR_TESTSUITE]: |
|
|
elif args[B.PAR_GRAN] in [J.GRAN_TS, B.PAR_TESTSUITE]: |
|
|
description = J.CHOICE_TS |
|
|
description = J.CHOICE_TS |
|
|
choiceList = job_tool.select_testsuite(job, programDef, args) |
|
|
choiceList = job_tool.select_testsuite(job, programDef, args) |
|
|
p = B.PAR_TESTSUITE |
|
|
p = B.PAR_TESTSUITE |
|
|
if J.ARG_TESTELEM in programDef[basic.program.CTLG_PARDEF]: args[J.ARG_TESTELEM] = p |
|
|
elif args[B.PAR_GRAN] in [J.GRAN_TC, B.PAR_TESTCASE]: |
|
|
elif p == B.PAR_TESTCASE or p == J.ARG_TESTELEM and args[B.PAR_GRAN] in [J.GRAN_TC, B.PAR_TESTCASE]: |
|
|
description = J.CHOICE_TC |
|
|
description = J.CHOICE_TC |
|
|
choiceList = job_tool.select_testcase(job, programDef, args) |
|
|
choiceList = job_tool.select_testcase(job, programDef, args) |
|
|
p = B.PAR_TESTCASE |
|
|
p = B.PAR_TESTCASE |
|
|
else: |
|
|
if J.ARG_TESTELEM in programDef[basic.program.CTLG_PARDEF]: args[J.ARG_TESTELEM] = p |
|
|
raise Exception("unknown testgranularity "+args[B.PAR_GRAN]) |
|
|
|
|
|
elif p == B.PAR_COMP: |
|
|
elif p == B.PAR_COMP: |
|
|
description = J.CHOICE_ENV |
|
|
description = J.CHOICE_ENV |
|
|
choiceList = job_tool.select_components(job, programDef, args[B.PAR_PROJ], args[B.PAR_APP]) |
|
|
choiceList = job_tool.select_components(job, programDef, args[B.PAR_PROJ], args[B.PAR_APP]) |
|
@ -168,26 +181,22 @@ def initDialog(job, args={}): |
|
|
elif p in [B.PAR_TESTPLAN, B.PAR_TESTSUITE, B.PAR_TESTCASE]: |
|
|
elif p in [B.PAR_TESTPLAN, B.PAR_TESTSUITE, B.PAR_TESTCASE]: |
|
|
if args[JOB_PROC] == J.PROC_REDO_EXECUTION: |
|
|
if args[JOB_PROC] == J.PROC_REDO_EXECUTION: |
|
|
description = J.CHOICE_ARCHIV |
|
|
description = J.CHOICE_ARCHIV |
|
|
choiceList = job_tool.select_archiv(job, programDef, args[J.MODEL_GRAN], args[B.PAR_APP]) |
|
|
choiceList = job_tool.select_archiv(job, programDef, args[B.PAR_GRAN], args[B.PAR_APP]) |
|
|
else: |
|
|
else: |
|
|
args[B.PAR_STEP] = "1" |
|
|
args[B.PAR_STEP] = "1" |
|
|
description = J.CHOICE_SPEC |
|
|
description = J.CHOICE_SPEC |
|
|
choiceList = job_tool.select_spec(job, programDef, args[J.MODEL_GRAN], args) |
|
|
choiceList = job_tool.select_spec(job, programDef, args[B.PAR_GRAN], args) |
|
|
elif p in [B.PAR_TSTIME, B.PAR_TCTIME] and args[JOB_PROC] in [J.PROC_REDO_EXECUTION]: |
|
|
elif p in [B.PAR_TSTIME, B.PAR_TCTIME] and args[JOB_PROC] in [J.PROC_REDO_EXECUTION]: |
|
|
description = J.CHOICE_TIME |
|
|
description = J.CHOICE_TIME |
|
|
choiceList = job_tool.select_testtime(job, programDef, args[J.MODEL_GRAN], args) |
|
|
choiceList = job_tool.select_testtime(job, programDef, args[B.PAR_GRAN], args) |
|
|
elif p == B.PAR_VAR: |
|
|
elif p == B.PAR_VAR: |
|
|
description = J.CHOICE_VARIANT |
|
|
description = J.CHOICE_VARIANT |
|
|
choiceList = job_tool.select_variant(job, programDef, args[J.MODEL_GRAN], args) |
|
|
choiceList = job_tool.select_variant(job, programDef, args[B.PAR_GRAN], args) |
|
|
else: |
|
|
else: |
|
|
continue |
|
|
continue |
|
|
if choiceList is None: |
|
|
if choiceList is None: |
|
|
job.m.logError(verify, "choiceList in None "+p) |
|
|
job.m.logError(verify, "choiceList in None "+p) |
|
|
args[p] = getChoice(job, choiceList, description) |
|
|
args[p] = getChoice(job, choiceList, description) |
|
|
else: |
|
|
|
|
|
args[p] = programDef[basic.program.CTLG_PARDEF][p] |
|
|
|
|
|
job.m.logDebug(verify, "p "+p+" jetzt ") |
|
|
|
|
|
job.m.logDebug(verify, args[p]) |
|
|
|
|
|
job.m.logDebug(verify, args) |
|
|
job.m.logDebug(verify, args) |
|
|
job_tool.write_child_args(job, args) |
|
|
job_tool.write_child_args(job, args) |
|
|
job_tool.start_child_process(job, args) |
|
|
job_tool.start_child_process(job, args) |
|
|