From d258bed56e1d88db377f59333e55c04b94d95fa5 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 24 Nov 2021 19:47:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95=E6=89=B9=E9=87=8F=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E6=89=A7=E8=A1=8C=E7=8A=B6=E6=80=81=E6=9C=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1008253 --user=lyh 【测试计划】性能测试批量执行,报告已经出来了,但是执行状态一直是run(单独执行正常) https://www.tapd.cn/55049933/s/1074755 --- .../commons/constants/ReportTriggerMode.java | 3 ++- .../track/service/LoadReportStatusEvent.java | 1 + .../track/service/TestPlanLoadCaseService.java | 16 ---------------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/backend/src/main/java/io/metersphere/commons/constants/ReportTriggerMode.java b/backend/src/main/java/io/metersphere/commons/constants/ReportTriggerMode.java index 2f393233d6..8a8d45c35d 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/ReportTriggerMode.java +++ b/backend/src/main/java/io/metersphere/commons/constants/ReportTriggerMode.java @@ -10,5 +10,6 @@ public enum ReportTriggerMode { CASE, TEST_PLAN_SCHEDULE, TEST_PLAN_API, - API_PLAN + API_PLAN, + BATCH } diff --git a/backend/src/main/java/io/metersphere/track/service/LoadReportStatusEvent.java b/backend/src/main/java/io/metersphere/track/service/LoadReportStatusEvent.java index 82d1c9bdc8..b6e2667afa 100644 --- a/backend/src/main/java/io/metersphere/track/service/LoadReportStatusEvent.java +++ b/backend/src/main/java/io/metersphere/track/service/LoadReportStatusEvent.java @@ -36,6 +36,7 @@ public class LoadReportStatusEvent implements LoadTestFinishEvent { @Override public void execute(LoadTestReport loadTestReport) { if (StringUtils.equals(ReportTriggerMode.MANUAL.name(), loadTestReport.getTriggerMode()) + || StringUtils.equals(ReportTriggerMode.BATCH.name(), loadTestReport.getTriggerMode()) || StringUtils.equals(ReportTriggerMode.TEST_PLAN_SCHEDULE.name(), loadTestReport.getTriggerMode()) || StringUtils.equals(ReportTriggerMode.TEST_PLAN_API.name(), loadTestReport.getTriggerMode())) { if (StringUtils.equalsAny(loadTestReport.getStatus(), diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanLoadCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanLoadCaseService.java index 1ae461ef32..c8b94cf828 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanLoadCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanLoadCaseService.java @@ -81,25 +81,9 @@ public class TestPlanLoadCaseService { public List list(LoadCaseRequest request) { request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders())); List testPlanLoadCaseDTOList = extTestPlanLoadCaseMapper.selectTestPlanLoadCaseList(request); - this.syncReportStatus(testPlanLoadCaseDTOList); return testPlanLoadCaseDTOList; } - private void syncReportStatus(List testPlanLoadCaseDTOList) { - for (TestPlanLoadCaseDTO dto : testPlanLoadCaseDTOList) { - if (StringUtils.isNotEmpty(dto.getLoadReportId()) && StringUtils.equalsIgnoreCase(dto.getStatus(), "run")) { - LoadTestReport report = loadTestReportMapper.selectByPrimaryKey(dto.getLoadReportId()); - if (report != null && StringUtils.equalsAnyIgnoreCase(report.getStatus(), "Starting", "Running", "Reporting")) { - dto.setStatus(report.getStatus()); - TestPlanLoadCaseWithBLOBs updateModel = new TestPlanLoadCaseWithBLOBs(); - updateModel.setId(dto.getId()); - updateModel.setStatus(report.getStatus()); - testPlanLoadCaseMapper.updateByPrimaryKeySelective(updateModel); - } - } - } - } - public List selectTestPlanLoadCaseIds(LoadCaseRequest request) { request.setOrders(ServiceUtils.getDefaultSortOrder(request.getOrders())); return extTestPlanLoadCaseMapper.selectTestPlanLoadCaseId(request);