From 80be2bb3437150c076d776490673588f2669c17e Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Tue, 17 Dec 2024 16:22:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=89=A7=E8=A1=8C=EF=BC=8C?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=B8=AD=E5=BC=95=E7=94=A8=E4=BA=86=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=EF=BC=8C=E6=89=A7=E8=A1=8C=E6=97=B6=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E4=BC=9A=E9=87=8D=E5=A4=8D=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1050539 --user=陈建星 【测试计划】github#34649,测试计划执行时,有时候步骤会执行多次 https://www.tapd.cn/55049933/s/1632547 --- .../PlanRunApiScenarioExecuteCallbackService.java | 2 +- .../service/PlanRunTestPlanApiScenarioService.java | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunApiScenarioExecuteCallbackService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunApiScenarioExecuteCallbackService.java index 6e6ca403b4..1c12d1615d 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunApiScenarioExecuteCallbackService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunApiScenarioExecuteCallbackService.java @@ -58,7 +58,7 @@ public class PlanRunApiScenarioExecuteCallbackService implements ApiExecuteCallb ApiScenarioDetail apiScenarioDetail = apiScenarioRunService.getForRunWithTaskItemErrorMassage(request.getTaskItem().getId(), testPlanReportApiScenario.getApiScenarioId()); apiScenarioDetail.setEnvironmentId(testPlanReportApiScenario.getEnvironmentId()); apiScenarioDetail.setGrouped(testPlanReportApiScenario.getGrouped()); - GetRunScriptResult result = planRunTestPlanApiScenarioService.getRunScript(request); + GetRunScriptResult result = apiScenarioRunService.getRunScript(request, apiScenarioDetail); String reportId = initReport(request, testPlanReportApiScenario, apiScenarioDetail); result.setReportId(reportId); return result; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java index c62c35af45..53215a34df 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java @@ -2,7 +2,6 @@ package io.metersphere.plan.service; import io.metersphere.api.domain.ApiScenario; import io.metersphere.api.domain.ApiScenarioReport; -import io.metersphere.api.dto.scenario.ApiScenarioDetail; import io.metersphere.api.mapper.ApiScenarioMapper; import io.metersphere.api.service.ApiBatchRunBaseService; import io.metersphere.api.service.ApiExecuteService; @@ -201,13 +200,4 @@ public class PlanRunTestPlanApiScenarioService { apiExecutionQueueService.deleteQueue(queue.getQueueId()); } } - - public GetRunScriptResult getRunScript(GetRunScriptRequest request) { - TaskItem taskItem = request.getTaskItem(); - TestPlanReportApiScenario testPlanReportApiScenario = testPlanReportApiScenarioMapper.selectByPrimaryKey(taskItem.getResourceId()); - ApiScenarioDetail apiScenarioDetail = apiScenarioRunService.getForRun(testPlanReportApiScenario.getApiScenarioId()); - apiScenarioDetail.setEnvironmentId(testPlanReportApiScenario.getEnvironmentId()); - apiScenarioDetail.setGrouped(testPlanReportApiScenario.getGrouped()); - return apiScenarioRunService.getRunScript(request, apiScenarioDetail); - } }