fix(接口测试): 修复7天失败用例top10中统计错误的问题
--bug=1015093 --user=宋天阳 【测试跟踪】首页-过去7天测试计划失败用例top10,用例/场景失败次数没增加 https://www.tapd.cn/55049933/s/1206419
This commit is contained in:
parent
dc8a848c4b
commit
b446062e65
|
@ -98,6 +98,7 @@ public class ApiDefinitionExecResultService {
|
||||||
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(), null);
|
ApiDefinitionExecResult result = this.editResult(item, dto.getReportId(), dto.getConsole(), dto.getRunMode(), dto.getTestId(), null);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
result.setResourceId(dto.getTestId());
|
||||||
apiExecutionInfoService.insertExecutionInfo(result);
|
apiExecutionInfoService.insertExecutionInfo(result);
|
||||||
User user = null;
|
User user = null;
|
||||||
if (MapUtils.isNotEmpty(dto.getExtendedParameters())) {
|
if (MapUtils.isNotEmpty(dto.getExtendedParameters())) {
|
||||||
|
@ -111,7 +112,6 @@ public class ApiDefinitionExecResultService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 发送通知
|
// 发送通知
|
||||||
result.setResourceId(dto.getTestId());
|
|
||||||
LoggerUtil.info("执行结果【 " + result.getName() + " 】入库存储完成");
|
LoggerUtil.info("执行结果【 " + result.getName() + " 】入库存储完成");
|
||||||
sendNotice(result, user);
|
sendNotice(result, user);
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ public class ApiDefinitionExecResultService {
|
||||||
triggerMode = reportResult.getTriggerMode();
|
triggerMode = reportResult.getTriggerMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MapUtils.isNotEmpty(expandDTO.getAttachInfoMap())) {
|
if (StringUtils.isNotEmpty(expandDTO.getStatus())) {
|
||||||
status = expandDTO.getStatus();
|
status = expandDTO.getStatus();
|
||||||
}
|
}
|
||||||
if (StringUtils.equalsAny(dto.getRunMode(), ApiRunMode.SCHEDULE_API_PLAN.name(), ApiRunMode.JENKINS_API_PLAN.name())) {
|
if (StringUtils.equalsAny(dto.getRunMode(), ApiRunMode.SCHEDULE_API_PLAN.name(), ApiRunMode.JENKINS_API_PLAN.name())) {
|
||||||
|
@ -425,6 +425,7 @@ public class ApiDefinitionExecResultService {
|
||||||
try {
|
try {
|
||||||
startTime = DateUtils.getDayStartTime(startDay);
|
startTime = DateUtils.getDayStartTime(startDay);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
LogUtil.error("解析日期出错!", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startTime == null) {
|
if (startTime == null) {
|
||||||
|
|
|
@ -94,15 +94,15 @@
|
||||||
testPlan.`name` AS testPlanName
|
testPlan.`name` AS testPlanName
|
||||||
FROM test_plan_api_scenario testPlanScenario
|
FROM test_plan_api_scenario testPlanScenario
|
||||||
INNER JOIN test_plan testPlan ON testPlan.id = testPlanScenario.test_plan_id) apiScene
|
INNER JOIN test_plan testPlan ON testPlan.id = testPlanScenario.test_plan_id) apiScene
|
||||||
ON apiScene.id = executionInfo.source_id
|
ON apiScene.api_scenario_id = executionInfo.source_id
|
||||||
INNER JOIN api_scenario scene ON scene.id = apiScene.api_scenario_id
|
INNER JOIN api_scenario scene ON scene.id = executionInfo.source_id
|
||||||
|
|
||||||
WHERE scene.project_id = #{projectId}
|
WHERE scene.project_id = #{projectId}
|
||||||
AND scene.`status` != 'Trash'
|
AND scene.`status` != 'Trash'
|
||||||
AND ( executionInfo.result = 'Error' OR executionInfo.result = 'Fail' )
|
AND ( executionInfo.result = 'Error' OR executionInfo.result = 'Fail' )
|
||||||
AND executionInfo.create_time >= #{startTimestamp}
|
AND executionInfo.create_time >= #{startTimestamp}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
scene.id
|
scene.id,apiScene.testPlanId
|
||||||
<if test="selectFunctionCase == true">
|
<if test="selectFunctionCase == true">
|
||||||
UNION
|
UNION
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -440,7 +440,8 @@
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
resource_id )maxdata ON maxdata.resource_id = execResult.resource_id AND maxdata.create_time = execResult.create_time;
|
resource_id )maxdata ON maxdata.resource_id = execResult.resource_id AND maxdata.create_time =
|
||||||
|
execResult.create_time;
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue