fix(测试跟踪): 优化执行测试计划时无可执行资源的测试计划处理方式

优化执行测试计划时无可执行资源的测试计划处理方式
This commit is contained in:
song-tianyang 2023-05-05 12:08:18 +08:00 committed by 建国
parent 976f6025c1
commit 7adf575d74
2 changed files with 13 additions and 2 deletions

View File

@ -3,7 +3,6 @@ package io.metersphere.plan.service;
import io.metersphere.base.domain.TestPlanWithBLOBs;
import io.metersphere.base.mapper.TestPlanMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanMapper;
import io.metersphere.commons.constants.TestPlanReportStatus;
import io.metersphere.commons.utils.JSON;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.constants.RunModeConstants;
@ -208,7 +207,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;
}

View File

@ -599,6 +599,18 @@ public class TestPlanReportService {
}
}
public void testPlanUnExecute(TestPlanReport testPlanReport) {
if (testPlanReport != null) {
testPlanReport.setIsApiCaseExecuting(false);
testPlanReport.setIsScenarioExecuting(false);
testPlanReport.setIsPerformanceExecuting(false);
testPlanReport.setIsUiScenarioExecuting(false);
testPlanReport.setStatus(TestPlanReportStatus.COMPLETED.name());
testPlanReportMapper.updateByPrimaryKey(testPlanReport);
this.executeTestPlanByQueue(testPlanReport.getId());
}
}
/**
* 测试计划报告设置最终执行状态
*/