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
2fa437de
Commit
2fa437de
authored
Apr 10, 2025
by
Wallen姚文辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加差异文件接口异常返回
parent
834651de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
codeCover.py
controller/codeCover.py
+5
-4
No files found.
controller/codeCover.py
View file @
2fa437de
...
@@ -23,6 +23,7 @@ lajiluoji={
...
@@ -23,6 +23,7 @@ lajiluoji={
def
getFileCover
(
key
,
a1
,
a2
,
a3
):
def
getFileCover
(
key
,
a1
,
a2
,
a3
):
res
=
requests
.
post
(
diff_path
+
'/get_gitcode'
,
json
=
{
'input1'
:
a1
,
'input2'
:
a2
,
'input3'
:
a3
})
.
json
()[
"data"
][
"result"
]
res
=
requests
.
post
(
diff_path
+
'/get_gitcode'
,
json
=
{
'input1'
:
a1
,
'input2'
:
a2
,
'input3'
:
a3
})
.
json
()[
"data"
][
"result"
]
print
(
res
)
data
=
[]
data
=
[]
for
key_
,
value
in
res
.
items
():
for
key_
,
value
in
res
.
items
():
data
.
append
({
"path"
:
key_
.
replace
(
lajiluoji
[
a3
],
''
),
"change_fun"
:
value
,
"cover_function"
:
0
,
data
.
append
({
"path"
:
key_
.
replace
(
lajiluoji
[
a3
],
''
),
"change_fun"
:
value
,
"cover_function"
:
0
,
...
@@ -78,10 +79,10 @@ def find_():
...
@@ -78,10 +79,10 @@ def find_():
info
=
db
.
session
.
query
(
CodeCoverLog
)
.
filter
(
CodeCoverLog
.
user_id
==
session
.
get
(
'id'
),
CodeCoverLog
.
product_key
==
key
)
.
first
()
info
=
db
.
session
.
query
(
CodeCoverLog
)
.
filter
(
CodeCoverLog
.
user_id
==
session
.
get
(
'id'
),
CodeCoverLog
.
product_key
==
key
)
.
first
()
db
.
session
.
close
()
db
.
session
.
close
()
data
=
getFileCover
(
key
,
info
.
commit_source
,
info
.
commit_target
,
info
.
product
)
data
=
getFileCover
(
key
,
info
.
commit_source
,
info
.
commit_target
,
info
.
product
)
#
try:
try
:
#
data=getFileCover(key,info.commit_source,info.commit_target,info.product)
data
=
getFileCover
(
key
,
info
.
commit_source
,
info
.
commit_target
,
info
.
product
)
#
except:
except
:
#
return jsonify({"code": 500, "message": "获取差异文件接口异常"}), 500
return
jsonify
({
"code"
:
500
,
"message"
:
"获取差异文件接口异常"
}),
500
res
=
requests
.
get
(
res
=
requests
.
get
(
"https://test-code-coverage.galaxy-immi.com/"
+
key
+
"/"
+
path
+
"/index.html"
"https://test-code-coverage.galaxy-immi.com/"
+
key
+
"/"
+
path
+
"/index.html"
)
)
...
...
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