Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test_platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Wallen姚文辉
test_platform
Commits
48e9dc8c
Commit
48e9dc8c
authored
Jul 11, 2024
by
Wallen姚文辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
脚本地址优化
parent
4ff37d09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
Tool.py
controller/Tool.py
+3
-13
No files found.
controller/Tool.py
View file @
48e9dc8c
...
...
@@ -392,24 +392,14 @@ def jobreporterpath(name):
@
tool
.
route
(
'/testport/runresult'
,
methods
=
[
"GET"
])
def
runresult
():
reportMap
=
{
"APP文案段主流程new"
:
"APP文案流程接口"
,
"DWP各页面主流程接口"
:
"DWP各页面主流程接口"
,
"smart-writing"
:
"smart-writing接口"
,
"sop以及私域"
:
"sop接口"
,
"全it"
:
"全it"
,
"售前总流程ling"
:
"售前Ling接口"
,
"售后主流程"
:
"售后主流程接口"
,
"银河E签接口自动化"
:
"银河E签接口自动化"
}
p
=
re
.
compile
(
r'echo total=(\d+)\s.+echo success=(\d+)\s.+echo fail=(\d+)'
,
re
.
MULTILINE
)
data
=
server
.
auto_jenkins
.
_get_view_jobs
(
"全流程"
)
m
=
[]
# m=map(lambda x:{""})
for
each
in
data
:
k
=
{
"job"
:
each
[
"name"
]}
number
=
server
.
auto_jenkins
.
get_job_info
(
each
[
"name"
])
.
get
(
"builds"
)[
0
][
"number"
]
a
=
server
.
auto_jenkins
.
get_job_config
(
each
[
"name"
])
soup
=
BeautifulSoup
(
a
,
"xml"
)
info
=
server
.
auto_jenkins
.
get_build_info
(
each
[
"name"
],
number
)
logs
=
server
.
auto_jenkins
.
get_build_console_output
(
each
[
"name"
],
number
)
res
=
p
.
findall
(
logs
)
...
...
@@ -418,7 +408,7 @@ def runresult():
k
[
"success"
]
=
res
[
0
][
1
]
k
[
"fail"
]
=
res
[
0
][
2
]
k
[
"running"
],
k
[
'result'
],
k
[
'time'
]
=
info
[
"building"
],
info
[
"result"
],
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
time
.
localtime
(
float
(
info
[
"timestamp"
])
/
1000
))
k
[
"reportPath"
]
=
server
.
auto_jenkins
.
server
+
'view/全流程/job/'
+
each
[
"name"
]
+
'/'
+
jobreporterpath
(
reportMap
[
each
[
"name"
]]
)
k
[
"reportPath"
]
=
server
.
auto_jenkins
.
server
+
'view/全流程/job/'
+
each
[
"name"
]
+
'/'
+
jobreporterpath
(
soup
.
find
(
"reportName"
)
.
text
.
replace
(
'测试报告'
,
""
)
)
m
.
append
(
k
)
return
jsonify
({
"code"
:
200
,
"message"
:
"请求成功"
,
"data"
:
m
}),
200
...
...
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