refactor(测试跟踪): 限制测试计划定时任务单一执行
Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
parent
e87e920ccd
commit
747ca01483
|
@ -155,7 +155,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectLastReportByTestPlanId" resultType="java.lang.String">
|
<select id="selectLastReportByTestPlanId" resultType="java.lang.String">
|
||||||
select `status` from test_plan_report where test_plan_id = #{testPlanId} ORDER BY create_time DESC LIMIT 1
|
select `status` from test_plan_report where test_plan_id = #{testPlanId} and trigger_mode = 'SCHEDULE' ORDER BY create_time DESC LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class TestPlanExecuteService {
|
||||||
}
|
}
|
||||||
TestPlanReport testPlanReport = null;
|
TestPlanReport testPlanReport = null;
|
||||||
try {
|
try {
|
||||||
this.checkTestPlanCanRunning(testPlanId, projectId, runModeConfig);
|
this.checkTestPlanCanRunning(testPlanId, projectId, runModeConfig, triggerMode);
|
||||||
//创建测试报告,然后返回的ID重新赋值为resourceID,作为后续的参数
|
//创建测试报告,然后返回的ID重新赋值为resourceID,作为后续的参数
|
||||||
TestPlanScheduleReportInfoDTO reportInfoDTO = testPlanService.genTestPlanReport(planReportId, testPlanId, userId, triggerMode, runModeConfig);
|
TestPlanScheduleReportInfoDTO reportInfoDTO = testPlanService.genTestPlanReport(planReportId, testPlanId, userId, triggerMode, runModeConfig);
|
||||||
testPlanReport = reportInfoDTO.getTestPlanReport();
|
testPlanReport = reportInfoDTO.getTestPlanReport();
|
||||||
|
@ -89,10 +89,10 @@ public class TestPlanExecuteService {
|
||||||
return planReportId;
|
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);
|
LogUtil.info("当前测试计划正在执行中,请稍后再试", testPlanId);
|
||||||
MSException.throwException(Translator.get("test_plan_run_message"));
|
MSException.throwException(Translator.get("test_plan_run_message"));
|
||||||
|
|
Loading…
Reference in New Issue