Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
automatedtestplatform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
automatedtestplatform
Commits
d595ef20
Commit
d595ef20
authored
Nov 28, 2022
by
王英豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改数据库地址,增加甘特图
parent
e5d3de9b
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
285 additions
and
48 deletions
+285
-48
AutomatedTestPlatform.iml
.idea/AutomatedTestPlatform.iml
+1
-1
misc.xml
.idea/misc.xml
+4
-1
django.run.xml
.run/django.run.xml
+21
-0
0006_auto_20221125_1434.py
automated_main/migrations/0006_auto_20221125_1434.py
+124
-0
testing_progress.cpython-37.pyc
...ting_progress/__pycache__/testing_progress.cpython-37.pyc
+0
-0
testing_progress.py
automated_main/models/testing_progress/testing_progress.py
+3
-2
testing_progress_url.cpython-37.pyc
...gress_url/__pycache__/testing_progress_url.cpython-37.pyc
+0
-0
testing_progress_url.py
...ted_main/url/testing_progress_url/testing_progress_url.py
+4
-2
performance_script_view.cpython-37.pyc
...script/__pycache__/performance_script_view.cpython-37.pyc
+0
-0
performance_script_view.py
...rmance_test/performance_script/performance_script_view.py
+2
-2
personnel_allocation_view.py
...rogress/personnel_allocation/personnel_allocation_view.py
+125
-39
release.cnf
release.cnf
+1
-1
No files found.
.idea/AutomatedTestPlatform.iml
View file @
d595ef20
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<excludeFolder
url=
"file://$MODULE_DIR$/tutorial-env"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/tutorial-env"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/venv"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/venv"
/>
</content>
</content>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.7"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.7
(AutomatedTestPlatform) (2)
"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
name=
"Django Lib"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Django Lib"
level=
"project"
/>
</component>
</component>
...
...
.idea/misc.xml
View file @
d595ef20
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.7"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.7 (AutomatedTestPlatform) (2)"
project-jdk-type=
"Python SDK"
/>
<component
name=
"PyCharmProfessionalAdvertiser"
>
<option
name=
"shown"
value=
"true"
/>
</component>
</project>
</project>
\ No newline at end of file
.run/django.run.xml
0 → 100644
View file @
d595ef20
<component
name=
"ProjectRunConfigurationManager"
>
<configuration
default=
"false"
name=
"django"
type=
"PythonConfigurationType"
factoryName=
"Python"
singleton=
"false"
>
<module
name=
"AutomatedTestPlatform"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
<option
name=
"SDK_HOME"
value=
"$PROJECT_DIR$/venv/bin/python"
/>
<option
name=
"WORKING_DIRECTORY"
value=
"$PROJECT_DIR$"
/>
<option
name=
"IS_MODULE_SDK"
value=
"false"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<EXTENSION
ID=
"PythonCoverageRunConfigurationExtension"
runner=
"coverage.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$"
/>
<option
name=
"PARAMETERS"
value=
"$FileDir$"
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"true"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
<option
name=
"MODULE_MODE"
value=
"false"
/>
<option
name=
"REDIRECT_INPUT"
value=
"false"
/>
<option
name=
"INPUT_FILE"
value=
""
/>
<method
v=
"2"
/>
</configuration>
</component>
\ No newline at end of file
automated_main/migrations/0006_auto_20221125_1434.py
0 → 100644
View file @
d595ef20
# Generated by Django 3.1.3 on 2022-11-25 14:34
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'automated_main'
,
'0005_auto_20221024_2044'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'apiglobalvariable'
,
name
=
'api_environment'
,
),
migrations
.
RemoveField
(
model_name
=
'apiinterfacescase'
,
name
=
'api_environment'
,
),
migrations
.
RemoveField
(
model_name
=
'apiinterfacescase'
,
name
=
'api_management'
,
),
migrations
.
RemoveField
(
model_name
=
'apiinterfacescase'
,
name
=
'dataBase'
,
),
migrations
.
RemoveField
(
model_name
=
'apiinterfacesparameterdata'
,
name
=
'api_test_case'
,
),
migrations
.
RemoveField
(
model_name
=
'apiinterfacesparameterextraction'
,
name
=
'api_test_case'
,
),
migrations
.
RemoveField
(
model_name
=
'apiscenarioscase'
,
name
=
'api_management'
,
),
migrations
.
RemoveField
(
model_name
=
'apiscenarioscaseassociated'
,
name
=
'interfaces_case'
,
),
migrations
.
RemoveField
(
model_name
=
'apiscenarioscaseassociated'
,
name
=
'sid'
,
),
migrations
.
RemoveField
(
model_name
=
'apitestplan'
,
name
=
'api_environment'
,
),
migrations
.
RemoveField
(
model_name
=
'apitestplan'
,
name
=
'api_management'
,
),
migrations
.
RemoveField
(
model_name
=
'apitestplan'
,
name
=
'database'
,
),
migrations
.
RemoveField
(
model_name
=
'apitestplanresult'
,
name
=
'api_test_plan'
,
),
migrations
.
RemoveField
(
model_name
=
'apitestplanresultassociated'
,
name
=
'api_result'
,
),
migrations
.
RemoveField
(
model_name
=
'apitestplanresultassociated'
,
name
=
'api_test_plan'
,
),
migrations
.
AddField
(
model_name
=
'testingprogress'
,
name
=
'testing_progress'
,
field
=
models
.
CharField
(
max_length
=
300
,
null
=
True
,
verbose_name
=
'测试进度'
),
),
migrations
.
AlterField
(
model_name
=
'testingprogress'
,
name
=
'duration'
,
field
=
models
.
TextField
(
default
=
''
,
max_length
=
1000
,
null
=
True
,
verbose_name
=
'测试内容-标题'
),
),
migrations
.
AlterField
(
model_name
=
'testingprogress'
,
name
=
'testing_progress_title'
,
field
=
models
.
CharField
(
max_length
=
500
,
verbose_name
=
'测试进度标题'
),
),
migrations
.
DeleteModel
(
name
=
'APIDatabase'
,
),
migrations
.
DeleteModel
(
name
=
'APIEnvironment'
,
),
migrations
.
DeleteModel
(
name
=
'APIGlobalVariable'
,
),
migrations
.
DeleteModel
(
name
=
'ApiInterfacesCase'
,
),
migrations
.
DeleteModel
(
name
=
'ApiInterfacesParameterData'
,
),
migrations
.
DeleteModel
(
name
=
'ApiInterfacesParameterExtraction'
,
),
migrations
.
DeleteModel
(
name
=
'ApiManagement'
,
),
migrations
.
DeleteModel
(
name
=
'ApiScenariosCase'
,
),
migrations
.
DeleteModel
(
name
=
'ApiScenariosCaseAssociated'
,
),
migrations
.
DeleteModel
(
name
=
'ApiTestPlan'
,
),
migrations
.
DeleteModel
(
name
=
'APITestPlanResult'
,
),
migrations
.
DeleteModel
(
name
=
'APITestPlanResultAssociated'
,
),
]
automated_main/models/testing_progress/__pycache__/testing_progress.cpython-37.pyc
View file @
d595ef20
No preview for this file type
automated_main/models/testing_progress/testing_progress.py
View file @
d595ef20
...
@@ -5,14 +5,15 @@ class TestingProgress(models.Model):
...
@@ -5,14 +5,15 @@ class TestingProgress(models.Model):
"""
"""
测试进度
测试进度
"""
"""
testing_progress_title
=
models
.
CharField
(
"测试进度标题"
,
max_length
=
50
,
null
=
False
)
testing_progress_title
=
models
.
CharField
(
"测试进度标题"
,
max_length
=
50
0
,
null
=
False
)
start_date
=
models
.
TextField
(
"开始时间"
,
default
=
""
,
max_length
=
200
,
null
=
True
)
start_date
=
models
.
TextField
(
"开始时间"
,
default
=
""
,
max_length
=
200
,
null
=
True
)
end_date
=
models
.
TextField
(
"开始时间"
,
default
=
""
,
max_length
=
200
,
null
=
True
)
end_date
=
models
.
TextField
(
"开始时间"
,
default
=
""
,
max_length
=
200
,
null
=
True
)
duration
=
models
.
TextField
(
"测试内容-标题"
,
default
=
""
,
max_length
=
2
00
,
null
=
True
)
duration
=
models
.
TextField
(
"测试内容-标题"
,
default
=
""
,
max_length
=
10
00
,
null
=
True
)
group
=
models
.
IntegerField
(
"是否分组"
,
default
=
1
)
# 1 是 0 不是
group
=
models
.
IntegerField
(
"是否分组"
,
default
=
1
)
# 1 是 0 不是
parent
=
models
.
IntegerField
(
"父id"
,
null
=
True
,
default
=
0
)
parent
=
models
.
IntegerField
(
"父id"
,
null
=
True
,
default
=
0
)
type
=
models
.
CharField
(
"图表颜色"
,
max_length
=
50
,
null
=
False
)
type
=
models
.
CharField
(
"图表颜色"
,
max_length
=
50
,
null
=
False
)
description
=
models
.
TextField
(
"描述"
,
default
=
""
,
max_length
=
20000
,
null
=
True
)
description
=
models
.
TextField
(
"描述"
,
default
=
""
,
max_length
=
20000
,
null
=
True
)
testing_progress
=
models
.
CharField
(
"测试进度"
,
max_length
=
300
,
null
=
True
)
update_time
=
models
.
DateTimeField
(
auto_now_add
=
True
)
update_time
=
models
.
DateTimeField
(
auto_now_add
=
True
)
create_time
=
models
.
DateTimeField
(
"创建时间"
,
auto_now_add
=
True
)
create_time
=
models
.
DateTimeField
(
"创建时间"
,
auto_now_add
=
True
)
...
...
automated_main/url/testing_progress_url/__pycache__/testing_progress_url.cpython-37.pyc
View file @
d595ef20
No preview for this file type
automated_main/url/testing_progress_url/testing_progress_url.py
View file @
d595ef20
...
@@ -4,10 +4,12 @@
...
@@ -4,10 +4,12 @@
# @File : testing_progress_url.py
# @File : testing_progress_url.py
# @desc:
# @desc:
from
django.urls
import
path
from
django.urls
import
path
from
automated_main.view.testing_progress.personnel_allocation.personnel_allocation_view
import
PersonnelAllocationView
from
automated_main.view.testing_progress.personnel_allocation.personnel_allocation_view
import
PersonnelAllocationView
,
PersonnelAllocationListView
urlpatterns
=
[
urlpatterns
=
[
path
(
"api/backend/personnel_allocation/"
,
PersonnelAllocationView
.
as_view
()),
path
(
"api/backend/personnel_allocation/"
,
PersonnelAllocationView
.
as_view
()),
path
(
"api/backend/personnel_allocation_list/"
,
PersonnelAllocationView
.
as_view
()),
path
(
"api/backend/personnel_allocation/<int:pid>/"
,
PersonnelAllocationView
.
as_view
()),
path
(
"api/backend/personnel_allocation_list/"
,
PersonnelAllocationListView
.
as_view
()),
]
]
\ No newline at end of file
automated_main/view/performance_test/performance_script/__pycache__/performance_script_view.cpython-37.pyc
View file @
d595ef20
No preview for this file type
automated_main/view/performance_test/performance_script/performance_script_view.py
View file @
d595ef20
...
@@ -129,7 +129,7 @@ class PerformanceScriptView(View):
...
@@ -129,7 +129,7 @@ class PerformanceScriptView(View):
:return:
:return:
"""
"""
PerformanceScript
.
objects
.
delete
()
PerformanceScript
.
objects
.
delete
(
id
=
performance_script_id
)
return
response_success
(
"删除单独性能脚本"
)
return
response_success
(
"删除单独性能脚本"
)
def
put
(
self
,
request
,
*
args
,
**
kwargs
):
def
put
(
self
,
request
,
*
args
,
**
kwargs
):
...
@@ -433,7 +433,7 @@ class PerformanceScriptReport(View):
...
@@ -433,7 +433,7 @@ class PerformanceScriptReport(View):
if
report_id
==
""
:
if
report_id
==
""
:
return
response_failed
({
"status"
:
10102
,
"message"
:
"report_id不能为空"
})
return
response_failed
({
"status"
:
10102
,
"message"
:
"report_id不能为空"
})
PerformanceReport
.
objects
.
delete
()
PerformanceReport
.
objects
.
get
(
id
=
report_id
)
.
delete
()
dir
=
settings
.
JMETER_REPORT
dir
=
settings
.
JMETER_REPORT
dir_list
=
os
.
listdir
(
dir
)
dir_list
=
os
.
listdir
(
dir
)
for
report
in
dir_list
:
for
report
in
dir_list
:
...
...
automated_main/view/testing_progress/personnel_allocation/personnel_allocation_view.py
View file @
d595ef20
...
@@ -4,49 +4,16 @@
...
@@ -4,49 +4,16 @@
# @File : personnel_allocation_view.py
# @File : personnel_allocation_view.py
# @desc:
# @desc:
from
django.views.generic
import
View
from
django.views.generic
import
View
from
automated_main.utils.http_format
import
response_success
,
response_failed
from
automated_main.utils.http_format
import
response_success
from
automated_main.exception.my_exception
import
MyException
from
automated_main.models.testing_progress.testing_progress
import
TestingProgress
from
automated_main.models.testing_progress.testing_progress
import
TestingProgress
import
json
import
json
import
arrow
import
arrow
import
datetime
import
time
class
PersonnelAllocationView
(
View
):
class
PersonnelAllocationView
(
View
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
"""
获取任务
"""
testing_progress_data
=
TestingProgress
.
objects
.
all
()
testing_progress_list
=
[]
for
testing_progress
in
testing_progress_data
:
if
testing_progress
.
group
==
"1"
:
render
=
"split"
else
:
render
=
""
if
testing_progress
.
parent
==
"0"
:
parent
=
""
else
:
parent
=
testing_progress
.
parent
testing_progress_dict
=
{
"text"
:
testing_progress
.
testing_progress_title
,
"start_date"
:
testing_progress
.
start_date
,
"id"
:
testing_progress
.
id
,
"duration"
:
testing_progress
.
duration
,
# "parent": "",
"type"
:
testing_progress
.
type
,
"end_date"
:
testing_progress
.
end_date
,
"render"
:
render
,
"description"
:
testing_progress
.
description
}
testing_progress_list
.
append
(
testing_progress_dict
)
return
response_success
(
testing_progress_list
)
def
put
(
self
,
request
,
*
args
,
**
kwargs
):
def
put
(
self
,
request
,
*
args
,
**
kwargs
):
"""
"""
新增测试任务
新增测试任务
...
@@ -57,18 +24,137 @@ class PersonnelAllocationView(View):
...
@@ -57,18 +24,137 @@ class PersonnelAllocationView(View):
data
=
json
.
loads
(
body
)
data
=
json
.
loads
(
body
)
TestingProgress
.
objects
.
create
(
testing_progress_title
=
data
[
'text'
],
TestingProgress
.
objects
.
create
(
testing_progress_title
=
data
[
'text'
],
start_date
=
arrow
.
get
(
str
(
data
[
'start_date'
]))
.
format
(
'YYYY-MM-DD'
)
,
start_date
=
data
[
'start_date'
]
,
end_date
=
arrow
.
get
(
str
(
data
[
'end_date'
]))
.
format
(
'YYYY-MM-DD'
)
,
end_date
=
data
[
'end_date'
]
,
duration
=
data
[
'duration'
],
duration
=
data
[
'duration'
],
group
=
data
[
'group'
],
group
=
data
[
'group'
],
parent
=
data
[
'parent'
],
parent
=
data
[
'parent'
],
testing_progress
=
data
[
'progress'
],
type
=
data
[
'color'
],
type
=
data
[
'color'
],
description
=
data
[
'description'
])
description
=
data
[
'description'
])
return
response_success
(
"创建成功"
)
return
response_success
(
"创建成功"
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
"""
修改任务
"""
body
=
request
.
body
if
not
body
:
return
response_success
()
data
=
json
.
loads
(
body
)
# print(data)
if
'group'
in
data
:
testing_progress
=
TestingProgress
.
objects
.
get
(
id
=
data
[
'id'
])
testing_progress
.
testing_progress_title
=
data
[
'text'
]
testing_progress
.
group
=
data
[
'group'
]
testing_progress
.
parent
=
data
[
'parent'
]
testing_progress
.
start_date
=
data
[
'start_date'
]
testing_progress
.
end_date
=
data
[
'end_date'
]
testing_progress
.
testing_progress
=
data
[
'progress'
]
testing_progress
.
description
=
data
[
'description'
]
testing_progress
.
type
=
data
[
'color'
]
testing_progress
.
save
()
else
:
testing_progress
=
TestingProgress
.
objects
.
get
(
id
=
data
[
'id'
])
testing_progress
.
testing_progress_title
=
data
[
'text'
]
# testing_progress.group = data['group']
testing_progress
.
parent
=
data
[
'parent'
]
testing_progress
.
testing_progress
=
data
[
'progress'
]
testing_progress
.
start_date
=
data
[
'start_date'
]
testing_progress
.
end_date
=
data
[
'end_date'
]
testing_progress
.
description
=
data
[
'description'
]
testing_progress
.
type
=
data
[
'color'
]
testing_progress
.
save
()
return
response_success
()
return
response_success
()
def
delete
(
self
,
*
args
,
**
kwargs
):
def
delete
(
self
,
request
,
pid
,
*
args
,
**
kwargs
):
"""
删除任务
"""
TestingProgress
.
objects
.
get
(
id
=
pid
)
.
delete
()
return
response_success
()
return
response_success
()
class
PersonnelAllocationListView
(
View
):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
"""
获取任务
"""
body
=
request
.
body
data
=
json
.
loads
(
body
)
# 查询时间
date_list_query
=
[]
begin_date_query
=
datetime
.
datetime
.
strptime
(
data
[
'data_time_personnel'
][
0
],
"
%
Y-
%
m-
%
d"
)
end_date_query
=
datetime
.
datetime
.
strptime
(
data
[
'data_time_personnel'
][
1
],
"
%
Y-
%
m-
%
d"
)
while
begin_date_query
<=
end_date_query
:
date_str
=
begin_date_query
.
strftime
(
"
%
Y-
%
m-
%
d"
)
date_list_query
.
append
(
date_str
)
begin_date_query
+=
datetime
.
timedelta
(
days
=
1
)
testing_progress_data
=
TestingProgress
.
objects
.
all
()
testing_progress_list
=
[]
for
testing_progress
in
testing_progress_data
:
if
testing_progress
.
group
==
1
:
render
=
"split"
testing_progress_dict
=
{
"text"
:
testing_progress
.
testing_progress_title
,
"id"
:
testing_progress
.
id
,
"render"
:
render
,
"group"
:
str
(
testing_progress
.
group
),
"color"
:
testing_progress
.
type
,
"description"
:
testing_progress
.
description
}
testing_progress_list
.
append
(
testing_progress_dict
)
else
:
render
=
""
# 任务的开始时间 转换 年月日时分
dates_start_date
=
time
.
strptime
(
testing_progress
.
start_date
,
"
%
Y-
%
m-
%
d
%
H:
%
M"
)
dates_start_date
=
time
.
strftime
(
"
%
Y-
%
m-
%
d"
,
dates_start_date
)
# 任务的结束时间 年月日时分
dates_end_date
=
time
.
strptime
(
testing_progress
.
end_date
,
"
%
Y-
%
m-
%
d
%
H:
%
M"
)
dates_end_date
=
time
.
strftime
(
"
%
Y-
%
m-
%
d"
,
dates_end_date
)
data_list_task
=
[]
date_start
=
datetime
.
datetime
.
strptime
(
dates_start_date
,
'
%
Y-
%
m-
%
d'
)
date_end
=
datetime
.
datetime
.
strptime
(
dates_end_date
,
'
%
Y-
%
m-
%
d'
)
data_list_task
.
append
(
date_start
.
strftime
(
'
%
Y-
%
m-
%
d'
))
while
date_start
<
date_end
:
date_start
+=
datetime
.
timedelta
(
days
=
1
)
data_list_task
.
append
(
date_start
.
strftime
(
'
%
Y-
%
m-
%
d'
))
set_c
=
set
(
date_list_query
)
&
set
(
data_list_task
)
list_c
=
list
(
set_c
)
if
len
(
list_c
)
>
0
:
if
testing_progress
.
parent
==
"0"
:
parent
=
""
else
:
parent
=
testing_progress
.
parent
testing_progress_dict
=
{
"text"
:
testing_progress
.
testing_progress_title
,
"start_date"
:
testing_progress
.
start_date
,
"id"
:
testing_progress
.
id
,
"duration"
:
testing_progress
.
duration
,
"parent"
:
parent
,
"type"
:
testing_progress
.
type
,
"end_date"
:
testing_progress
.
end_date
,
"render"
:
render
,
"progress"
:
testing_progress
.
testing_progress
,
"group"
:
str
(
testing_progress
.
group
),
"color"
:
testing_progress
.
type
,
"description"
:
testing_progress
.
description
}
testing_progress_list
.
append
(
testing_progress_dict
)
else
:
pass
return
response_success
(
testing_progress_list
)
release.cnf
View file @
d595ef20
[client]
[client]
host = 172.16.92.55
host = 172.16.92.55
port = 3
1257
port = 3
0241
user = qa
user = qa
password = qatest
password = qatest
database = test_qa
database = test_qa
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment