fix(测试跟踪): 测试计划失败用例TOP10统计批量执行失败的用例

--bug=1020237 --user=宋昌昌 【测试跟踪】首页-过去7天测试计划失败用例TOP 10-失败次数没统计批量执行失败的用例 https://www.tapd.cn/55049933/s/1304585
This commit is contained in:
song-cc-rock 2022-11-24 16:23:18 +08:00 committed by jianxing
parent 61926434ae
commit 3a977e134b
2 changed files with 13 additions and 3 deletions

View File

@ -138,8 +138,12 @@ public class ApiDefinitionExecResultService {
for (RequestResult item : dto.getRequestResults()) { for (RequestResult item : dto.getRequestResults()) {
if (!StringUtils.startsWithAny(item.getName(), "PRE_PROCESSOR_ENV_", "POST_PROCESSOR_ENV_")) { if (!StringUtils.startsWithAny(item.getName(), "PRE_PROCESSOR_ENV_", "POST_PROCESSOR_ENV_")) {
ApiDefinitionExecResult result = this.editResult(item, dto.getReportId(), dto.getConsole(), dto.getRunMode(), dto.getTestId(), definitionExecResultMapper); ApiDefinitionExecResult result = this.editResult(item, dto.getReportId(), dto.getConsole(), dto.getRunMode(), dto.getTestId(), definitionExecResultMapper);
// 批量更新关联关系状态 if (result != null) {
batchEditStatus(dto.getRunMode(), result.getStatus(), result.getId(), dto.getTestId(), batchApiTestCaseMapper); result.setResourceId(dto.getTestId());
apiExecutionInfoService.insertExecutionInfo(result);
// 批量更新关联关系状态
batchEditStatus(dto.getRunMode(), result.getStatus(), result.getId(), dto.getTestId(), batchApiTestCaseMapper);
}
if (result != null && !StringUtils.startsWithAny(dto.getRunMode(), "SCHEDULE")) { if (result != null && !StringUtils.startsWithAny(dto.getRunMode(), "SCHEDULE")) {
User user = null; User user = null;
if (MapUtils.isNotEmpty(dto.getExtendedParameters()) && dto.getExtendedParameters().containsKey("user") && dto.getExtendedParameters().get("user") instanceof User) { if (MapUtils.isNotEmpty(dto.getExtendedParameters()) && dto.getExtendedParameters().containsKey("user") && dto.getExtendedParameters().get("user") instanceof User) {

View File

@ -236,7 +236,13 @@ public class TestPlanTestCaseService {
testPlanTestCaseMapper.updateByExampleSelective( testPlanTestCaseMapper.updateByExampleSelective(
testPlanTestCase, testPlanTestCase,
testPlanTestCaseExample); testPlanTestCaseExample);
if (StringUtils.isNotBlank(testPlanTestCase.getStatus()) &&
!StringUtils.equals(TestPlanTestCaseStatus.Prepare.name(), testPlanTestCase.getStatus())) {
//记录功能用例执行信息
request.getIds().forEach(caseId -> {
functionCaseExecutionInfoService.insertExecutionInfo(caseId, testPlanTestCase.getStatus());
});
}
if (StringUtils.isNotBlank(request.getStatus())) { if (StringUtils.isNotBlank(request.getStatus())) {
List<String> caseIds = extTestPlanTestCaseMapper.getCaseIdsByIds(request.getIds()); List<String> caseIds = extTestPlanTestCaseMapper.getCaseIdsByIds(request.getIds());
testCaseService.updateLastExecuteStatus(caseIds, request.getStatus()); testCaseService.updateLastExecuteStatus(caseIds, request.getStatus());