fix(接口测试): 用例执行状态处理
--bug=1007755 --user=赵勇 【接口测试】case批量执行一直是进行中,并且没有显示结果 https://www.tapd.cn/55049933/s/1065437
This commit is contained in:
parent
3c30089dfa
commit
3ba19fbf5b
|
@ -795,8 +795,8 @@ public class ApiTestCaseService {
|
|||
sqlSession.commit();
|
||||
|
||||
for (RunCaseRequest runCaseRequest : executeQueue) {
|
||||
run(runCaseRequest);
|
||||
MessageCache.batchTestCases.put(runCaseRequest.getReportId(), runCaseRequest.getReport());
|
||||
run(runCaseRequest);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -819,6 +819,13 @@ public class ApiTestCaseService {
|
|||
jMeterService.runLocal(request.getReportId(), jmeterHashTree, null, request.getRunMode());
|
||||
|
||||
} catch (Exception ex) {
|
||||
ApiDefinitionExecResult result = MessageCache.batchTestCases.get(request.getReportId());
|
||||
result.setStatus("error");
|
||||
apiDefinitionExecResultMapper.updateByPrimaryKey(result);
|
||||
ApiTestCaseWithBLOBs caseWithBLOBs = apiTestCaseMapper.selectByPrimaryKey(request.getCaseId());
|
||||
caseWithBLOBs.setStatus("error");
|
||||
apiTestCaseMapper.updateByPrimaryKey(caseWithBLOBs);
|
||||
MessageCache.batchTestCases.remove(request.getReportId());
|
||||
LogUtil.error(ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue