fix(测试计划): 修复测试计划用例串行顺序不准确问题

--bug=1009552 --user=赵勇 【接口测试】测试用例批量执行,串行,执行顺序不对 https://www.tapd.cn/55049933/s/1092705
This commit is contained in:
fit2-zhao 2022-01-17 10:23:49 +08:00 committed by jianxing
parent f2f85d7b55
commit f9940473a9
1 changed files with 2 additions and 1 deletions

View File

@ -74,6 +74,7 @@ public class ApiCaseExecuteService {
request.getConfig().setEnvMap(environmentGroupProjectService.getEnvMap(request.getConfig().getEnvironmentGroupId())); request.getConfig().setEnvMap(environmentGroupProjectService.getEnvMap(request.getConfig().getEnvironmentGroupId()));
} }
LoggerUtil.debug("开始查询测试计划用例"); LoggerUtil.debug("开始查询测试计划用例");
TestPlanApiCaseExample example = new TestPlanApiCaseExample(); TestPlanApiCaseExample example = new TestPlanApiCaseExample();
example.createCriteria().andIdIn(ids); example.createCriteria().andIdIn(ids);
example.setOrderByClause("`order` DESC"); example.setOrderByClause("`order` DESC");
@ -84,8 +85,8 @@ public class ApiCaseExecuteService {
request.setTriggerMode(ApiRunMode.API_PLAN.name()); request.setTriggerMode(ApiRunMode.API_PLAN.name());
} }
Map<String, ApiDefinitionExecResult> executeQueue = new LinkedHashMap<>();
List<MsExecResponseDTO> responseDTOS = new LinkedList<>(); List<MsExecResponseDTO> responseDTOS = new LinkedList<>();
Map<String, ApiDefinitionExecResult> executeQueue = new HashMap<>();
String status = request.getConfig().getMode().equals(RunModeConstants.SERIAL.toString()) ? APITestStatus.Waiting.name() : APITestStatus.Running.name(); String status = request.getConfig().getMode().equals(RunModeConstants.SERIAL.toString()) ? APITestStatus.Waiting.name() : APITestStatus.Running.name();
planApiCases.forEach(testPlanApiCase -> { planApiCases.forEach(testPlanApiCase -> {
ApiDefinitionExecResult report = ApiDefinitionExecResultUtil.addResult(request, testPlanApiCase, status, batchMapper); ApiDefinitionExecResult report = ApiDefinitionExecResultUtil.addResult(request, testPlanApiCase, status, batchMapper);