fix(接口测试): 修复场景定时任务执行失效问题
This commit is contained in:
parent
d04602ae67
commit
7d39a9228b
|
@ -9,6 +9,7 @@ import io.metersphere.commons.constants.ReportTriggerMode;
|
||||||
import io.metersphere.commons.constants.ScheduleGroup;
|
import io.metersphere.commons.constants.ScheduleGroup;
|
||||||
import io.metersphere.commons.utils.CommonBeanFactory;
|
import io.metersphere.commons.utils.CommonBeanFactory;
|
||||||
import io.metersphere.commons.utils.LogUtil;
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
|
import io.metersphere.constants.RunModeConstants;
|
||||||
import io.metersphere.dto.RunModeConfigDTO;
|
import io.metersphere.dto.RunModeConfigDTO;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.quartz.*;
|
import org.quartz.*;
|
||||||
|
@ -67,12 +68,15 @@ public class ApiScenarioTestJob extends MsScheduleJob {
|
||||||
request.setIds(this.scenarioIds);
|
request.setIds(this.scenarioIds);
|
||||||
request.setReportUserID(this.userId);
|
request.setReportUserID(this.userId);
|
||||||
request.setRunMode(ApiRunMode.SCHEDULE_SCENARIO.name());
|
request.setRunMode(ApiRunMode.SCHEDULE_SCENARIO.name());
|
||||||
|
|
||||||
JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
|
JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
|
||||||
String config = jobDataMap.getString("config");
|
String config = jobDataMap.getString("config");
|
||||||
if (StringUtils.isNotBlank(config)) {
|
if (StringUtils.isNotBlank(config)) {
|
||||||
RunModeConfigDTO runModeConfig = JSONObject.parseObject(config, RunModeConfigDTO.class);
|
RunModeConfigDTO runModeConfig = JSONObject.parseObject(config, RunModeConfigDTO.class);
|
||||||
request.setConfig(runModeConfig);
|
request.setConfig(runModeConfig);
|
||||||
|
} else {
|
||||||
|
RunModeConfigDTO runModeConfigDTO = new RunModeConfigDTO();
|
||||||
|
runModeConfigDTO.setMode(RunModeConstants.PARALLEL.toString());
|
||||||
|
request.setConfig(runModeConfigDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
apiAutomationService.run(request);
|
apiAutomationService.run(request);
|
||||||
|
|
Loading…
Reference in New Issue