From 07aa7a94cd90c6aecb32089244e4afb3759725d4 Mon Sep 17 00:00:00 2001 From: LuoTing <36292514+luty2018@users.noreply.github.com> Date: Mon, 19 Sep 2022 18:28:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1016909 --user=宋天阳 【接口测试】首页场景用例数量统计未执行数量不正确 https://www.tapd.cn/55049933/s/1245805 --- .github/ISSUE_TEMPLATE/question.yml | 4 ++-- .../java/io/metersphere/api/controller/APITestController.java | 2 +- .../api/dto/datacount/response/ApiDataCountDTO.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 2147b1f371..f9df41fd13 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -2,11 +2,11 @@ name: 问题咨询 description: 提出针对本项目安装部署、使用及其他方面的相关问题 title: "[QUESTION]" labels: question -assignees: Hyyfit +assignees: luty2018 body: - type: textarea id: description attributes: label: "请描述您的问题" validations: - required: true \ No newline at end of file + required: true diff --git a/backend/src/main/java/io/metersphere/api/controller/APITestController.java b/backend/src/main/java/io/metersphere/api/controller/APITestController.java index b6b64429ff..316c4da679 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APITestController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APITestController.java @@ -249,7 +249,7 @@ public class APITestController { apiCountResult.setExecutionPassCount(executionPassCount); apiCountResult.setFakeErrorCount(fakeErrorCount); - if (unexecuteCount + executedCountNumber + executionPassCount > 0) { + if (unexecuteCount + executionFailedCount + executionPassCount + fakeErrorCount > 0) { //通过率 float coverageRageNumber = (float) executionPassCount * 100 / (unexecuteCount + executedCountNumber + executionPassCount); DecimalFormat df = new DecimalFormat("0.0"); diff --git a/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java index b27c952d5f..db9f6fe1dd 100644 --- a/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java +++ b/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java @@ -184,7 +184,7 @@ public class ApiDataCountDTO { public void countRunResult(List countResultByRunResult) { for (ApiDataCountResult countResult : countResultByRunResult) { - if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), "notRun", "unexecute")) { + if (StringUtils.equalsAnyIgnoreCase(countResult.getGroupField(), "notRun", "unexecute") || StringUtils.isEmpty(countResult.getGroupField())) { this.unexecuteCount += countResult.getCountNumber(); } else if ("Fail".equals(countResult.getGroupField())) { this.executionFailedCount += countResult.getCountNumber();