parent
9253d25b5d
commit
e4e421f90a
|
@ -204,13 +204,10 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ApiScenarioReport savedReport = apiScenarioReportService.get(testId);
|
ApiScenarioReport savedReport = apiScenarioReportService.get(testId);
|
||||||
String scenarioID = null;
|
String scenarioID = "";
|
||||||
if(savedReport!=null){
|
if(savedReport!=null){
|
||||||
scenarioID = savedReport.getScenarioId();
|
scenarioID = savedReport.getScenarioId();
|
||||||
}
|
}
|
||||||
if(scenarioID==null){
|
|
||||||
scenarioID = apiScenarioReportService.getApiScenarioId(scenaName, scenarioReport.getProjectId());
|
|
||||||
}
|
|
||||||
|
|
||||||
testResult.setTestId(scenarioID);
|
testResult.setTestId(scenarioID);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -88,7 +88,18 @@ public class ApiDefinitionExecResultService {
|
||||||
if (startTime == null) {
|
if (startTime == null) {
|
||||||
return new ArrayList<>(0);
|
return new ArrayList<>(0);
|
||||||
} else {
|
} else {
|
||||||
return extApiDefinitionExecResultMapper.findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber(projectId, startTime.getTime(), limitNumber);
|
List<ExecutedCaseInfoResult>list = extApiDefinitionExecResultMapper.findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber(projectId, startTime.getTime());
|
||||||
|
|
||||||
|
List<ExecutedCaseInfoResult> returnList = new ArrayList<>(limitNumber);
|
||||||
|
for(int i = 0;i<list.size();i++){
|
||||||
|
if(i<limitNumber){
|
||||||
|
returnList.add(list.get(i));
|
||||||
|
}else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,6 @@ public interface ExtApiDefinitionExecResultMapper {
|
||||||
|
|
||||||
long countByTestCaseIDInProject(String projectId);
|
long countByTestCaseIDInProject(String projectId);
|
||||||
|
|
||||||
List<ExecutedCaseInfoResult> findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber(@Param("projectId") String projectId, @Param("startTimestamp") long startTimestamp, @Param("limitNumber") int limitNumber);
|
List<ExecutedCaseInfoResult> findFaliureCaseInfoByProjectIDAndExecuteTimeAndLimitNumber(@Param("projectId") String projectId, @Param("startTimestamp") long startTimestamp);
|
||||||
|
|
||||||
}
|
}
|
|
@ -52,9 +52,9 @@
|
||||||
UNION
|
UNION
|
||||||
SELECT scene.`name` AS caseName,apiScene.testPlanName AS testPlan,count(report.id) AS failureTimes,'scenario' AS caseType
|
SELECT scene.`name` AS caseName,apiScene.testPlanName AS testPlan,count(report.id) AS failureTimes,'scenario' AS caseType
|
||||||
FROM api_scenario_report report
|
FROM api_scenario_report report
|
||||||
INNER JOIN api_scenario_report_detail reportDetail ON report.id = reportDetail.report_id
|
INNER JOIN api_scenario_report_detail reportDetail ON report.id = reportDetail.report_id
|
||||||
INNER JOIN api_scenario scene ON report.scenario_id = scene.id
|
INNER JOIN api_scenario scene ON report.scenario_id = scene.id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
apiScene.api_scenario_id,
|
apiScene.api_scenario_id,
|
||||||
|
@ -65,10 +65,9 @@
|
||||||
GROUP BY apiScene.api_scenario_id
|
GROUP BY apiScene.api_scenario_id
|
||||||
)apiScene ON apiScene.api_scenario_id = scene.id
|
)apiScene ON apiScene.api_scenario_id = scene.id
|
||||||
WHERE report.project_id = #{projectId}
|
WHERE report.project_id = #{projectId}
|
||||||
AND report.status = 'Error' AND report.create_time >= #{startTimestamp}
|
AND ( report.STATUS = 'Error' OR report.STATUS = 'Fail' ) AND report.create_time >= #{startTimestamp}
|
||||||
GROUP BY scene.id
|
GROUP BY scene.id
|
||||||
) showTable
|
) showTable
|
||||||
ORDER BY showTable.failureTimes DESC
|
ORDER BY showTable.failureTimes DESC
|
||||||
limit #{limitNumber}
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -115,11 +115,11 @@
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="countByProjectID" resultType="java.lang.Long">
|
<select id="countByProjectID" resultType="java.lang.Long">
|
||||||
SELECT COUNT(id) AS countNumber FROM api_scenario WHERE project_id = #{0}
|
SELECT COUNT(id) AS countNumber FROM api_scenario WHERE project_id = #{0} AND status != 'Trash'
|
||||||
</select>
|
</select>
|
||||||
<select id="countByProjectIDAndCreatInThisWeek" resultType="java.lang.Long">
|
<select id="countByProjectIDAndCreatInThisWeek" resultType="java.lang.Long">
|
||||||
SELECT count(id) AS countNumber FROM api_scenario
|
SELECT count(id) AS countNumber FROM api_scenario
|
||||||
WHERE project_id = #{projectId}
|
WHERE project_id = #{projectId} AND status != 'Trash'
|
||||||
AND create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
|
AND create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue