From 27b173791aa8f3ba5ba34550dcd24c9ec78ee45a Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Fri, 5 May 2023 12:08:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=A7=E8=A1=8C=E6=B5=8B=E8=AF=95=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=97=B6=E6=97=A0=E5=8F=AF=E6=89=A7=E8=A1=8C=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E7=9A=84=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化执行测试计划时无可执行资源的测试计划处理方式 --- .../plan/service/TestPlanExecuteService.java | 3 +-- .../plan/service/TestPlanReportService.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java index 418f957f5d..d1237054d6 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java @@ -2,7 +2,6 @@ package io.metersphere.plan.service; import io.metersphere.base.domain.TestPlanWithBLOBs; import io.metersphere.base.mapper.TestPlanMapper; -import io.metersphere.commons.constants.TestPlanReportStatus; import io.metersphere.commons.utils.JSON; import io.metersphere.commons.utils.LogUtil; import io.metersphere.constants.RunModeConstants; @@ -199,7 +198,7 @@ public class TestPlanExecuteService { testPlanReportService.createTestPlanReportContentReportIds(planReportId, apiTestCases, scenarioCases, uiScenarios, loadCaseReportMap); if (!haveApiCaseExec && !haveScenarioCaseExec && !haveLoadCaseExec && !haveUICaseExec) { //如果没有执行的自动化用例,调用结束测试计划的方法。 因为方法中包含着测试计划执行队列的处理逻辑。 - testPlanReportService.testPlanExecuteOver(planReportId, TestPlanReportStatus.COMPLETED.name()); + testPlanReportService.testPlanUnExecute(reportInfoDTO.getTestPlanReport()); } return planReportId; } diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanReportService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanReportService.java index b876d4e95e..b510359906 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanReportService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanReportService.java @@ -605,6 +605,18 @@ public class TestPlanReportService { } } + public void testPlanUnExecute(TestPlanReport testPlanReport) { + if (testPlanReport != null && !StringUtils.equalsIgnoreCase(testPlanReport.getStatus(), TestPlanReportStatus.COMPLETED.name())) { + testPlanReport.setIsApiCaseExecuting(false); + testPlanReport.setIsScenarioExecuting(false); + testPlanReport.setIsPerformanceExecuting(false); + testPlanReport.setIsUiScenarioExecuting(false); + testPlanReport.setStatus(TestPlanReportStatus.COMPLETED.name()); + testPlanReportMapper.updateByPrimaryKey(testPlanReport); + this.executeTestPlanByQueue(testPlanReport.getId()); + } + } + /** * 测试计划报告设置最终执行状态 */