fix(测试计划): 修复聚合报告一键总结问题
This commit is contained in:
parent
36504c28cc
commit
062d4536bd
|
@ -39,9 +39,24 @@ public class TestPlanReportDetailResponse {
|
||||||
@Schema(description = "计划总数")
|
@Schema(description = "计划总数")
|
||||||
private Integer planCount;
|
private Integer planCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一键总结参数
|
||||||
|
*/
|
||||||
|
@Schema(description = "通过的计划数量 - 计划组报告使用")
|
||||||
|
private Integer passCountOfPlan = 0;
|
||||||
|
@Schema(description = "未通过的计划数量 - 计划组报告使用")
|
||||||
|
private Integer failCountOfPlan = 0;
|
||||||
|
@Schema(description = "功能用例明细的缺陷数量")
|
||||||
|
private Integer functionalBugCount = 0;
|
||||||
|
@Schema(description = "功能用例明细的缺陷数量")
|
||||||
|
private Integer apiBugCount = 0;
|
||||||
|
@Schema(description = "功能用例明细的缺陷数量")
|
||||||
|
private Integer scenarioBugCount = 0;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "用例总数")
|
@Schema(description = "用例总数")
|
||||||
private Integer caseTotal = 0;
|
private Integer caseTotal = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行分析
|
* 执行分析
|
||||||
*/
|
*/
|
||||||
|
@ -63,6 +78,7 @@ public class TestPlanReportDetailResponse {
|
||||||
@Schema(description = "接口场景用例分析-用例数")
|
@Schema(description = "接口场景用例分析-用例数")
|
||||||
private CaseCount apiScenarioCount;
|
private CaseCount apiScenarioCount;
|
||||||
|
|
||||||
|
@Schema(description = "报告是否删除")
|
||||||
private boolean deleted;
|
private boolean deleted;
|
||||||
|
|
||||||
@Schema(description = "报告状态")
|
@Schema(description = "报告状态")
|
||||||
|
|
|
@ -60,4 +60,11 @@ public interface ExtTestPlanReportFunctionalCaseMapper {
|
||||||
* @return 关联的用例集合
|
* @return 关联的用例集合
|
||||||
*/
|
*/
|
||||||
List<ReportDetailCasePageDTO> list(@Param("request") TestPlanReportDetailPageRequest request);
|
List<ReportDetailCasePageDTO> list(@Param("request") TestPlanReportDetailPageRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计用例明细的关联缺陷数
|
||||||
|
* @param reportId 报告ID
|
||||||
|
* @return 缺陷数量
|
||||||
|
*/
|
||||||
|
Long countBug(@Param("id") String reportId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,11 @@
|
||||||
<include refid="filter"/>
|
<include refid="filter"/>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="countBug" resultType="java.lang.Long">
|
||||||
|
select sum(function_case_bug_count) from test_plan_report_function_case tprfc
|
||||||
|
where tprfc.test_plan_report_id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
<sql id="filter">
|
<sql id="filter">
|
||||||
<if test="request.filter != null and request.filter.size() > 0">
|
<if test="request.filter != null and request.filter.size() > 0">
|
||||||
<foreach collection="request.filter.entrySet()" index="key" item="values">
|
<foreach collection="request.filter.entrySet()" index="key" item="values">
|
||||||
|
|
|
@ -482,7 +482,19 @@ public class TestPlanReportService {
|
||||||
int caseTotal = (int) (reportSummary.getFunctionalCaseCount() + reportSummary.getApiCaseCount() + reportSummary.getApiScenarioCount());
|
int caseTotal = (int) (reportSummary.getFunctionalCaseCount() + reportSummary.getApiCaseCount() + reportSummary.getApiScenarioCount());
|
||||||
planReportDetail.setCaseTotal(caseTotal);
|
planReportDetail.setCaseTotal(caseTotal);
|
||||||
planReportDetail.setBugCount(reportSummary.getBugCount().intValue());
|
planReportDetail.setBugCount(reportSummary.getBugCount().intValue());
|
||||||
planReportDetail.setPlanCount(reportSummary.getPlanCount().intValue());
|
// 暂时只有功能用例能关联缺陷
|
||||||
|
Long functionalBugCount = extTestPlanReportFunctionalCaseMapper.countBug(reportId);
|
||||||
|
planReportDetail.setFunctionalBugCount(functionalBugCount.intValue());
|
||||||
|
if (planReport.getIntegrated()) {
|
||||||
|
// 计划组报告, 需要统计计划的执行数据
|
||||||
|
planReportDetail.setPlanCount(reportSummary.getPlanCount().intValue());
|
||||||
|
TestPlanReportExample reportExample = new TestPlanReportExample();
|
||||||
|
reportExample.createCriteria().andParentIdEqualTo(reportId);
|
||||||
|
List<TestPlanReport> testPlanReports = testPlanReportMapper.selectByExample(reportExample);
|
||||||
|
long planPassCount = testPlanReports.stream().filter(report -> StringUtils.equals(ExecStatus.SUCCESS.name(), report.getResultStatus())).count();
|
||||||
|
planReportDetail.setPassCountOfPlan((int) planPassCount);
|
||||||
|
planReportDetail.setFailCountOfPlan(planReportDetail.getPlanCount() - planReportDetail.getPassCountOfPlan());
|
||||||
|
}
|
||||||
planReportDetail.setSummary(reportSummary.getSummary());
|
planReportDetail.setSummary(reportSummary.getSummary());
|
||||||
/*
|
/*
|
||||||
* 统计用例执行数据
|
* 统计用例执行数据
|
||||||
|
|
Loading…
Reference in New Issue