From fc822112b52334478bfefc6fe3b746245c47f539 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 7 Sep 2022 17:25:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=8A=A5=E5=91=8A=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=80=9A=E8=BF=87=E7=8E=87=E8=AE=A1=E7=AE=97=E6=9C=89?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1016639 --user=陈建星 【测试跟踪】整体执行测试计划后,测试跟踪 - 报告列表,显示的报告成功率不对 https://www.tapd.cn/55049933/s/1240095 --- .../track/service/TestPlanReportService.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java index d176965b05..c0fd19883b 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java @@ -216,16 +216,14 @@ public class TestPlanReportService { TestPlanUtils.buildStatusResultMap(planReportCaseDTOS, statusResultMap, report, TestPlanLoadCaseStatus.success.name()); } } + + report.setExecuteRate(0.0); + report.setPassRate(0.0); + // 设置成功率 - 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()); }