Browse Source

application

refactor
Ulrich 2 years ago
parent
commit
b6f822c375
  1. 109
      basic/DATASTRUCTURE.yml
  2. 2
      basic/application.py
  3. 33
      basic/program.py
  4. 2
      utils/config_tool.py

109
basic/DATASTRUCTURE.yml

@ -66,6 +66,22 @@ ap_component:
field: component
index: I
type: str
ap_application:
_header:
- apappid
- apid
- application
apappid:
field: apappid
type: pk
apid:
field: apid
index: I
type: int
application:
field: component
index: I
type: str
ap_project:
_header:
- approid
@ -90,9 +106,9 @@ ap_project:
reference:
field: reference
type: str
component:
environment:
_header:
- coid
- enid
- name
- description
- reference
@ -104,8 +120,8 @@ component:
- updauthor
- updtime
- actual
coid:
field: apid
enid:
field: enid
type: pk
name:
field: name
@ -142,36 +158,50 @@ component:
field: actual
index: I
type: int
connection:
en_project:
_header:
- coid
- environment
- enproid
- enid
- project
enproid:
field: enproid
type: pk
enid:
field: enid
index: I
type: int
project:
field: project
index: I
type: str
en_component:
_header:
- encomid
- enid
- component
- instance
- type
- ip
- port
- hostname
- dompath
- user
- password
- attributes
- inscommit
- insauthor
- instime
- updcommit
- updauthor
- updtime
- actual
cnid:
field: cnid
encomid:
field: encomid
type: pk
environment:
field: environment
enid:
field: enid
index: I
type: str
type: int
component:
field: component
index: I
type: string
type: str
instance:
field: instance
type: int
type:
field: type
type: str
@ -187,6 +217,42 @@ connection:
dompath:
field: dompath
type: str
user:
field: user
type: str
password:
field: password
type: str
attributes:
field: attributes
type: string
component:
_header:
- coid
- name
- description
- reference
- attributes
- inscommit
- insauthor
- instime
- updcommit
- updauthor
- updtime
- actual
coid:
field: apid
type: pk
name:
field: name
index: I
type: str
description:
field: description
type: string
reference:
field: reference
type: str
attributes:
field: attributes
type: string
@ -212,3 +278,4 @@ connection:
field: actual
index: I
type: int

2
basic/application.py

@ -76,7 +76,7 @@ def getEnvironments(job, projectList):
if os.path.exists(pathname):
doc = utils.file_tool.readFileDict(job, pathname, job.m)
print(str(doc))
for proj in doc["env"]["general"][B.SUBJECT_PROJECTS]:
for proj in doc[B.SUBJECT_ENV][B.CONF_NODE_GENERAL][B.SUBJECT_PROJECTS]:
if proj in projectList:
projects[proj][B.SUBJECT_ENV].append(envdir)
return projects

33
basic/program.py

@ -23,6 +23,9 @@ import test.constants as T
import utils.path_const as P
import utils.job_tool
LIMIT_INFO = 16 #basic.message.LIMIT_INFO
LIMIT_DEBUG = 12 #basic.message.LIMIT_DEBUG
jobdef = {
"webflask": {
"pardef": "",
@ -30,7 +33,7 @@ jobdef = {
"pfiletarget": "",
"basedir": "workbase",
"dirname": "workdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.conf.data}/workspace/webflask_{job.start:H}.txt" },
"declare_result": {
"pardef": "",
@ -38,7 +41,7 @@ jobdef = {
"pfiletarget": "",
"basedir": "workbase",
"dirname": "workdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.conf.data}/workspace/reorg_{job.start:H}.txt" },
"service": {
"pardef": "",
@ -46,7 +49,7 @@ jobdef = {
"pfiletarget": "",
"basedir": "workbase",
"dirname": "workdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.conf.data}/workspace/service_{job.start:H}.txt" },
"unit": {
"pardef": "",
@ -54,7 +57,7 @@ jobdef = {
"pfiletarget": "",
"basedir": "workbase",
"dirname": "workdir",
"loglevel": basic.message.LIMIT_DEBUG,
"loglevel": LIMIT_DEBUG,
"logpath": "{job.conf.data}/workspace/unittest_{job.start:H}.txt" },
"check_environment": {
"pardef": "",
@ -62,7 +65,7 @@ jobdef = {
"pfiletarget": "envparfile",
"basedir": "envbase",
"dirname": "envdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.envdir}/{log}/log_{job.start}.txt" },
"test_executer": {
"pardef": "",
@ -70,7 +73,7 @@ jobdef = {
"pfiletarget": "tsparfile",
"basedir": "tsbase",
"dirname": "tsdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.tsdir}/{log}/{job.program}_{job.start}.txt" },
"init_testsuite": {
"pardef": "tsdir", # ,tdtyp,tdsrc,tdname",
@ -78,7 +81,7 @@ jobdef = {
"pfiletarget": "tsparfile",
"basedir": "tsbase",
"dirname": "tsdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.tsdir}/{log}/{job.program}_{job.start}.txt" },
"init_testcase": {
"pardef": "tcdir", # ",tdtyp,tdsrc,tdname",
@ -86,7 +89,7 @@ jobdef = {
"pfiletarget": "tcparfile",
"basedir": "tcbase",
"dirname": "tcdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.tcdir}/{log}/{job.program}_{job.start}.txt" },
"execute_testcase": {
"pardef": "tcdir", # ",tdtyp,tdsrc,tdname",
@ -94,7 +97,7 @@ jobdef = {
"pfiletarget": "tcparfile",
"basedir": "tcbase",
"dirname": "tcdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.tcdir}/{log}/{job.program}_{job.start}.txt" },
"collect_testcase": {
"pardef": "tcdir", # ",tdtyp,tdsrc,tdname",
@ -102,7 +105,7 @@ jobdef = {
"pfiletarget": "tcparfile",
"basedir": "tcbase",
"dirname": "tcdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.tcdir}/{log}/{job.program}_{job.start}.txt" },
"copy_appdummy": {
"pardef": "tcdir", # ",tdtyp,tdsrc,tdname",
@ -110,7 +113,7 @@ jobdef = {
"pfiletarget": "tcparfile",
"basedir": "tcbase",
"dirname": "tcdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.tcdir}/{log}/{job.program}_{job.start}.txt"},
"compare_testcase": {
"pardef": "tcdir", # ",tdtyp,tdsrc,tdname",
@ -118,7 +121,7 @@ jobdef = {
"pfiletarget": "tcparfile",
"basedir": "tcbase",
"dirname": "tcdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.tcdir}/{log}/{job.program}_{job.start}.txt" },
"test_system": {
"pardef": "tcdir,tdtyp,tdsrc,tdname",
@ -126,7 +129,7 @@ jobdef = {
"pfiletarget": "tsparfile",
"basedir": "tcbase",
"dirname": "tcdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.tcdir}/{log}/{job.program}_{job.start}.txt"},
"finish_testcase": {
"pardef": "tcdir",
@ -134,7 +137,7 @@ jobdef = {
"pfiletarget": "tcparfile",
"basedir": "tcbase",
"dirname": "tcdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.tcdir}/{log}/{job.program}_{job.start}.txt"},
"finish_testsuite": {
"pardef": "tsdir",
@ -142,7 +145,7 @@ jobdef = {
"pfiletarget": "tssarfile",
"basedir": "tsbase",
"dirname": "tsdir",
"loglevel": basic.message.LIMIT_INFO,
"loglevel": LIMIT_INFO,
"logpath": "{job.par.tcdir}/{log}/{job.program}_{job.start}.txt"}
}

2
utils/config_tool.py

@ -26,6 +26,8 @@ CONFIG_FORMAT = [D.DFILE_TYPE_YML, D.DFILE_TYPE_JSON, D.DFILE_TYPE_CSV]
def getExistgetConfigPath(job, pathnames):
for p in pathnames:
if p[-1:] == ".":
p = p[0:-1]
for format in CONFIG_FORMAT:
pathname = p+"."+format
if os.path.exists(pathname):

Loading…
Cancel
Save