Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
d9b3831b
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 大约 3 年
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d9b3831b
编写于
8月 19, 2020
作者:
W
wenyann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(测试跟踪): 新增缺陷列表,缺陷数
上级
6e8f7f47
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
36 addition
and
13 deletion
+36
-13
backend/src/main/java/io/metersphere/base/domain/Issues.java
backend/src/main/java/io/metersphere/base/domain/Issues.java
+3
-0
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
...metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
+3
-2
backend/src/main/java/io/metersphere/track/domain/ReportResultComponent.java
...va/io/metersphere/track/domain/ReportResultComponent.java
+6
-6
backend/src/main/java/io/metersphere/track/dto/TestCaseReportMetricDTO.java
...ava/io/metersphere/track/dto/TestCaseReportMetricDTO.java
+2
-0
backend/src/main/java/io/metersphere/track/dto/TestCaseReportModuleResultDTO.java
.../metersphere/track/dto/TestCaseReportModuleResultDTO.java
+3
-0
backend/src/main/java/io/metersphere/track/dto/TestPlanCaseDTO.java
...c/main/java/io/metersphere/track/dto/TestPlanCaseDTO.java
+1
-0
backend/src/main/java/io/metersphere/track/service/TestPlanService.java
...in/java/io/metersphere/track/service/TestPlanService.java
+12
-3
frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue
...s/track/plan/view/comonents/report/TestCaseReportView.vue
+6
-2
未找到文件。
backend/src/main/java/io/metersphere/base/domain/Issues.java
浏览文件 @
d9b3831b
package
io.metersphere.base.domain
;
import
java.io.Serializable
;
import
lombok.Data
;
@Data
...
...
@@ -23,5 +24,7 @@ public class Issues implements Serializable {
private
String
description
;
private
String
model
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
浏览文件 @
d9b3831b
...
...
@@ -115,9 +115,10 @@
</select>
<select
id=
"list"
resultType=
"io.metersphere.track.dto.TestPlanCaseDTO"
>
select test_plan_test_case.*, test_case.*
select test_plan_test_case.*, test_case.*
,test_case_node.name as model
from test_plan_test_case
inner join test_case on test_plan_test_case.case_id = test_case.id
inner join test_case on test_plan_test_case.case_id = test_case.id left join test_case_node on
test_case_node.id=test_case.node_id
<where>
<if
test=
"request.combine != null"
>
<include
refid=
"combine"
>
...
...
backend/src/main/java/io/metersphere/track/domain/ReportResultComponent.java
浏览文件 @
d9b3831b
package
io.metersphere.track.domain
;
import
com.alibaba.fastjson.JSON
;
import
io.metersphere.base.domain.Issues
;
import
io.metersphere.base.domain.TestCaseNode
;
import
io.metersphere.base.domain.TestCaseNodeExample
;
import
io.metersphere.base.mapper.TestCaseNodeMapper
;
...
...
@@ -8,6 +9,7 @@ import io.metersphere.commons.constants.TestPlanTestCaseStatus;
import
io.metersphere.commons.utils.CommonBeanFactory
;
import
io.metersphere.commons.utils.MathUtils
;
import
io.metersphere.track.dto.*
;
import
io.metersphere.track.service.IssuesService
;
import
io.metersphere.track.service.TestCaseNodeService
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -78,7 +80,9 @@ public class ReportResultComponent extends ReportComponent {
}
private
void
getModuleResultMap
(
Map
<
String
,
Set
<
String
>>
childIdMap
,
Map
<
String
,
TestCaseReportModuleResultDTO
>
moduleResultMap
,
TestPlanCaseDTO
testCase
,
List
<
TestCaseNodeDTO
>
nodeTrees
)
{
IssuesService
issuesService
=
(
IssuesService
)
CommonBeanFactory
.
getBean
(
"issuesService"
);
childIdMap
.
forEach
((
rootNodeId
,
childIds
)
->
{
if
(
childIds
.
contains
(
testCase
.
getNodeId
()))
{
TestCaseReportModuleResultDTO
moduleResult
=
moduleResultMap
.
get
(
rootNodeId
);
if
(
moduleResult
==
null
)
{
...
...
@@ -112,15 +116,11 @@ public class ReportResultComponent extends ReportComponent {
if
(
StringUtils
.
equals
(
testCase
.
getStatus
(),
TestPlanTestCaseStatus
.
Blocking
.
name
()))
{
moduleResult
.
setBlockingCount
(
moduleResult
.
getBlockingCount
()
+
1
);
}
if
(
StringUtils
.
isNotBlank
(
testCase
.
getIssues
()))
{
if
(
JSON
.
parseObject
(
testCase
.
getIssues
()).
getBoolean
(
"hasIssues"
))
{
moduleResult
.
setIssuesCount
(
moduleResult
.
getIssuesCount
()
+
1
);
}
;
}
moduleResult
.
setIssuesCount
(
moduleResult
.
getIssuesCount
()
+
issuesService
.
getIssues
(
testCase
.
getCaseId
()).
size
());
moduleResultMap
.
put
(
rootNodeId
,
moduleResult
);
return
;
}
});
}
}
backend/src/main/java/io/metersphere/track/dto/TestCaseReportMetricDTO.java
浏览文件 @
d9b3831b
package
io.metersphere.track.dto
;
import
io.metersphere.base.domain.Issues
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
@@ -12,6 +13,7 @@ public class TestCaseReportMetricDTO {
private
List
<
TestCaseReportStatusResultDTO
>
executeResult
;
private
List
<
TestCaseReportModuleResultDTO
>
moduleExecuteResult
;
private
List
<
TestPlanCaseDTO
>
failureTestCases
;
private
List
<
Issues
>
Issues
;
private
List
<
String
>
executors
;
private
String
principal
;
private
Long
startTime
;
...
...
backend/src/main/java/io/metersphere/track/dto/TestCaseReportModuleResultDTO.java
浏览文件 @
d9b3831b
package
io.metersphere.track.dto
;
import
io.metersphere.base.domain.Issues
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.util.List
;
@Getter
@Setter
public
class
TestCaseReportModuleResultDTO
{
...
...
backend/src/main/java/io/metersphere/track/dto/TestPlanCaseDTO.java
浏览文件 @
d9b3831b
...
...
@@ -16,4 +16,5 @@ public class TestPlanCaseDTO extends TestCaseWithBLOBs {
private
String
caseId
;
private
String
issues
;
private
String
reportId
;
private
String
model
;
}
backend/src/main/java/io/metersphere/track/service/TestPlanService.java
浏览文件 @
d9b3831b
...
...
@@ -15,6 +15,7 @@ import io.metersphere.commons.constants.TestPlanStatus;
import
io.metersphere.commons.constants.TestPlanTestCaseStatus
;
import
io.metersphere.commons.exception.MSException
;
import
io.metersphere.commons.user.SessionUser
;
import
io.metersphere.commons.utils.CommonBeanFactory
;
import
io.metersphere.commons.utils.MathUtils
;
import
io.metersphere.commons.utils.ServiceUtils
;
import
io.metersphere.commons.utils.SessionUtils
;
...
...
@@ -43,7 +44,6 @@ import java.util.stream.Collectors;
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
TestPlanService
{
@Resource
TestPlanMapper
testPlanMapper
;
...
...
@@ -252,7 +252,7 @@ public class TestPlanService {
}
public
TestCaseReportMetricDTO
getMetric
(
String
planId
)
{
IssuesService
issuesService
=
(
IssuesService
)
CommonBeanFactory
.
getBean
(
"issuesService"
);
QueryTestPlanRequest
queryTestPlanRequest
=
new
QueryTestPlanRequest
();
queryTestPlanRequest
.
setId
(
planId
);
...
...
@@ -264,16 +264,25 @@ public class TestPlanService {
List
<
ReportComponent
>
components
=
ReportComponentFactory
.
createComponents
(
componentIds
.
toJavaList
(
String
.
class
),
testPlan
);
List
<
TestPlanCaseDTO
>
testPlanTestCases
=
listTestCaseByPlanId
(
planId
);
List
<
Issues
>
issues
=
new
ArrayList
<>();
for
(
TestPlanCaseDTO
testCase
:
testPlanTestCases
)
{
List
<
Issues
>
issue
=
issuesService
.
getIssues
(
testCase
.
getCaseId
());
if
(
issue
.
size
()
>
0
)
{
for
(
Issues
i
:
issue
)
{
i
.
setModel
(
testCase
.
getModel
());
}
issues
.
addAll
(
issue
);
}
components
.
forEach
(
component
->
{
component
.
readRecord
(
testCase
);
});
}
TestCaseReportMetricDTO
testCaseReportMetricDTO
=
new
TestCaseReportMetricDTO
();
components
.
forEach
(
component
->
{
component
.
afterBuild
(
testCaseReportMetricDTO
);
});
testCaseReportMetricDTO
.
setIssues
(
issues
);
return
testCaseReportMetricDTO
;
}
...
...
frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue
浏览文件 @
d9b3831b
...
...
@@ -202,7 +202,8 @@
},
getMetric
()
{
this
.
result
=
this
.
$get
(
'
/test/plan/get/metric/
'
+
this
.
planId
,
response
=>
{
this
.
metric
=
response
.
data
;
this
.
metric
=
response
.
data
if
(
!
this
.
metric
.
failureTestCases
)
{
this
.
metric
.
failureTestCases
=
[];
}
...
...
@@ -213,7 +214,10 @@
this
.
metric
.
moduleExecuteResult
=
[];
}
/*缺陷列表*/
this
.
metric
.
defectList
=
[];
if
(
!
this
.
metric
.
issues
)
{
this
.
metric
.
issues
=
[];
}
if
(
this
.
report
.
startTime
)
{
this
.
metric
.
startTime
=
new
Date
(
this
.
report
.
startTime
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录