fix(测试跟踪): 测试计划报告列表通过率计算有误

--bug=1016639 --user=陈建星 【测试跟踪】整体执行测试计划后,测试跟踪 - 报告列表,显示的报告成功率不对 https://www.tapd.cn/55049933/s/1240095
This commit is contained in:
chenjianxing 2022-09-07 17:25:24 +08:00 committed by f2c-ci-robot[bot]
parent c95204c94b
commit fc822112b5
1 changed files with 7 additions and 9 deletions

View File

@ -216,16 +216,14 @@ public class TestPlanReportService {
TestPlanUtils.buildStatusResultMap(planReportCaseDTOS, statusResultMap, report, TestPlanLoadCaseStatus.success.name());
}
}
// 设置成功率
if (report.getCaseCount() != null && report.getCaseCount() != 0 && report.getExecuteCount() != 0) {
report.setExecuteRate(report.getExecuteCount() * 0.1 * 10 / report.getCaseCount());
} else {
report.setExecuteRate(0.0);
}
if (report.getPassCount() != 0 && report.getCaseCount() != null && report.getExecuteCount() != 0) {
report.setPassRate(report.getPassCount() * 0.1 * 10 / report.getExecuteCount());
} else {
report.setPassRate(0.0);
// 设置成功率
if (report.getCaseCount() != null && report.getCaseCount() != 0) {
report.setExecuteRate(report.getExecuteCount() * 1.0 / report.getCaseCount());
report.setPassRate(report.getPassCount() * 1.0 / report.getCaseCount());
}
testPlanReportDTO.setPassRate(report.getPassRate());
}