From aad6e26e8e734dcbcc6f437130c55a994f35d33e Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 16 Feb 2023 18:03:22 +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=E5=81=9C=E6=AD=A2=E8=B0=83=E8=AF=95=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E8=AF=95=E8=AE=B0=E5=BD=95=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=9C=AA=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023177 --user=赵勇 【接口测试】github#21873,接口自动化调试过程中点击停止,调试历史列表中状态不会更新 https://www.tapd.cn/55049933/s/1336738 --- .../controller/scenario/ApiScenarioController.java | 4 ++-- .../service/scenario/ApiScenarioReportService.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java b/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java index a7e0f0d9ef..bde9bb972f 100644 --- a/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java +++ b/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java @@ -328,11 +328,11 @@ public class ApiScenarioController { List reportIds = new ArrayList<>(); TaskRequestDTO taskRequest = new TaskRequestDTO(); taskRequest.setReportId(reportId); - taskRequest.setType(ElementConstants.SCENARIO); + taskRequest.setType(ElementConstants.SCENARIO_UPPER); reportIds.add(taskRequest); WebSocketUtil.onClose(reportId); - apiTaskService.stop(reportIds); + apiTaskService.apiStop(reportIds); } } diff --git a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java index fb6eff5695..73c4229cdb 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java @@ -44,6 +44,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import jakarta.annotation.Resource; + import java.nio.charset.StandardCharsets; import java.util.*; import java.util.stream.Collectors; @@ -262,7 +263,8 @@ public class ApiScenarioReportService { report = new ApiScenarioReportWithBLOBs(); report.setId(reportId); } - if (StringUtils.equals(reportType, RunModeConstants.SET_REPORT.toString())) { + if (StringUtils.equals(reportType, RunModeConstants.SET_REPORT.toString()) + || StringUtils.equals(report.getStatus(), ApiReportStatus.STOPPED.name())) { return report; } if (StringUtils.equals(runMode, CommonConstants.CASE)) {