From 747ca014835c140ca7a05e50dc0b477a4383df9d Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 23 Aug 2023 17:47:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):?= =?UTF-8?q?=20=E9=99=90=E5=88=B6=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=8D=95=E4=B8=80=E6=89=A7?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fit2-zhao --- .../metersphere/base/mapper/ext/ExtTestPlanReportMapper.xml | 2 +- .../plan/service/execute/TestPlanExecuteService.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.xml index bc3ab90e6f..1bbe2bf64c 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanReportMapper.xml @@ -155,7 +155,7 @@ diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/execute/TestPlanExecuteService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/execute/TestPlanExecuteService.java index 7a0eb3dd6e..abf9b03108 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/execute/TestPlanExecuteService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/execute/TestPlanExecuteService.java @@ -71,7 +71,7 @@ public class TestPlanExecuteService { } TestPlanReport testPlanReport = null; try { - this.checkTestPlanCanRunning(testPlanId, projectId, runModeConfig); + this.checkTestPlanCanRunning(testPlanId, projectId, runModeConfig, triggerMode); //创建测试报告,然后返回的ID重新赋值为resourceID,作为后续的参数 TestPlanScheduleReportInfoDTO reportInfoDTO = testPlanService.genTestPlanReport(planReportId, testPlanId, userId, triggerMode, runModeConfig); testPlanReport = reportInfoDTO.getTestPlanReport(); @@ -89,10 +89,10 @@ public class TestPlanExecuteService { return planReportId; } - private void checkTestPlanCanRunning(String testPlanId, String projectId, RunModeConfigDTO runModeConfig) throws Exception { + private void checkTestPlanCanRunning(String testPlanId, String projectId, RunModeConfigDTO runModeConfig, String triggerMode) throws Exception { // 校验测试计划是否在执行中 - if (testPlanService.checkTestPlanIsRunning(testPlanId)) { + if (StringUtils.startsWith(triggerMode, "SCHEDULE") && testPlanService.checkTestPlanIsRunning(testPlanId)) { LogUtil.info("当前测试计划正在执行中,请稍后再试", testPlanId); MSException.throwException(Translator.get("test_plan_run_message"));