Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-api
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
1
Merge Requests
1
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
qa-api
Commits
6c9f2f1d
Commit
6c9f2f1d
authored
Dec 12, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加sonar结果
parent
6f82194f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
sonar.js
app/controller/sonar.js
+18
-7
No files found.
app/controller/sonar.js
View file @
6c9f2f1d
...
@@ -153,7 +153,6 @@ const queryHandle = function (query) {
...
@@ -153,7 +153,6 @@ const queryHandle = function (query) {
}
}
}
}
const
getSonarJob
=
async
(
ctx
)
=>
{
const
getSonarJob
=
async
(
ctx
)
=>
{
const
query
=
ctx
.
request
.
body
.
query
const
query
=
ctx
.
request
.
body
.
query
const
page
=
ctx
.
request
.
body
.
page
const
page
=
ctx
.
request
.
body
.
page
...
@@ -177,7 +176,8 @@ const fetchQuality = async (ctx) => {
...
@@ -177,7 +176,8 @@ const fetchQuality = async (ctx) => {
if
(
!
prev
[
next
.
projectName
])
{
if
(
!
prev
[
next
.
projectName
])
{
prev
[
next
.
projectName
]
=
{
prev
[
next
.
projectName
]
=
{
exception
:
0
,
exception
:
0
,
fail
:
0
,
error
:
0
,
warn
:
0
,
success
:
0
,
success
:
0
,
sum
:
0
,
sum
:
0
,
}
}
...
@@ -187,10 +187,20 @@ const fetchQuality = async (ctx) => {
...
@@ -187,10 +187,20 @@ const fetchQuality = async (ctx) => {
prev
[
next
.
projectName
].
sum
+=
1
prev
[
next
.
projectName
].
sum
+=
1
}
}
if
(
next
.
buildResult
===
'
success
'
)
{
if
(
next
.
buildResult
===
'
success
'
)
{
if
(
next
.
sonarResult
===
'
OK
'
)
{
switch
(
next
.
sonarResult
)
{
prev
[
next
.
projectName
].
success
+=
1
case
'
OK
'
:
}
else
{
prev
[
next
.
projectName
].
success
+=
1
prev
[
next
.
projectName
].
fail
+=
1
break
case
'
FAILED
'
:
prev
[
next
.
projectName
].
exception
+=
1
break
case
'
WARN
'
:
prev
[
next
.
projectName
].
warn
+=
1
break
case
'
ERROR
'
:
prev
[
next
.
projectName
].
error
+=
1
break
default
:
}
}
prev
[
next
.
projectName
].
sum
+=
1
prev
[
next
.
projectName
].
sum
+=
1
}
}
...
@@ -203,7 +213,8 @@ const fetchQuality = async (ctx) => {
...
@@ -203,7 +213,8 @@ const fetchQuality = async (ctx) => {
res
.
push
({
res
.
push
({
projectName
:
i
,
projectName
:
i
,
success
:
data
[
i
].
success
,
success
:
data
[
i
].
success
,
fail
:
data
[
i
].
fail
,
warn
:
data
[
i
].
warn
,
error
:
data
[
i
].
error
,
exception
:
data
[
i
].
exception
,
exception
:
data
[
i
].
exception
,
run
:
data
[
i
].
sum
,
run
:
data
[
i
].
sum
,
})
})
...
...
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