refactor(接口测试): 优化更新执行结果方法

This commit is contained in:
fit2-zhao 2022-05-06 18:37:12 +08:00 committed by halo-ci-bot[bot]
parent da2846edef
commit 1f5e80efd7
2 changed files with 8 additions and 8 deletions

View File

@ -176,7 +176,7 @@
</select>
<update id="stopScenario">
update api_scenario_report set status ='STOP' where
update api_scenario_report set status ='STOP' where status in ("running","starting","waiting") and
project_id in
<foreach collection="request.projects" item="id" separator="," open="(" close=")">
#{id}
@ -185,7 +185,7 @@
<update id="stopApi">
update api_definition_exec_result set status ='STOP' where
update api_definition_exec_result set status ='STOP' where status in ("running","starting","waiting") and
project_id in
<foreach collection="request.projects" item="id" separator="," open="(" close=")">
#{id}

View File

@ -193,13 +193,13 @@ public class TaskService {
execThreadPoolExecutor.removeQueue(item.getId());
PoolExecBlockingQueueUtil.offer(item.getId());
}
LoggerUtil.info("结束API进行中的报告");
extTaskMapper.stopApi(taskCenterRequest);
// 清理队列并停止测试计划报告
LoggerUtil.info("清理API执行链");
List<String> ids = results.stream().map(ApiDefinitionExecResult::getId).collect(Collectors.toList());
apiExecutionQueueService.stop(ids);
}
LoggerUtil.info("结束API进行中的报告");
extTaskMapper.stopApi(taskCenterRequest);
// 清理队列并停止测试计划报告
LoggerUtil.info("清理API执行链");
List<String> ids = results.stream().map(ApiDefinitionExecResult::getId).collect(Collectors.toList());
apiExecutionQueueService.stop(ids);
}
if (taskRequestMap.containsKey("SCENARIO")) {
List<ApiScenarioReport> reports = extApiScenarioReportMapper.findByProjectIds(taskCenterRequest);