parent
ed68556937
commit
35462667e3
|
@ -188,11 +188,11 @@ public class ApiDataCountDTO {
|
||||||
for (ApiDataCountResult countResult : allExecuteResult) {
|
for (ApiDataCountResult countResult : allExecuteResult) {
|
||||||
if("Success".equals(countResult.getGroupField())){
|
if("Success".equals(countResult.getGroupField())){
|
||||||
this.successCount+= countResult.getCountNumber();
|
this.successCount+= countResult.getCountNumber();
|
||||||
}else if("Error".equals(countResult.getGroupField())){
|
this.executedCount+= countResult.getCountNumber();
|
||||||
|
}else if("Error".equals(countResult.getGroupField())||"Fail".equals(countResult.getGroupField())){
|
||||||
this.failedCount+= countResult.getCountNumber();
|
this.failedCount+= countResult.getCountNumber();
|
||||||
}
|
|
||||||
|
|
||||||
this.executedCount+= countResult.getCountNumber();
|
this.executedCount+= countResult.getCountNumber();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -179,26 +179,29 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
||||||
testResult.setTestId(testId);
|
testResult.setTestId(testId);
|
||||||
ApiScenarioReport scenarioReport = apiScenarioReportService.complete(testResult, this.runMode);
|
ApiScenarioReport scenarioReport = apiScenarioReportService.complete(testResult, this.runMode);
|
||||||
|
|
||||||
|
|
||||||
report = new ApiTestReport();
|
report = new ApiTestReport();
|
||||||
report.setStatus(scenarioReport.getStatus());
|
report.setStatus(scenarioReport.getStatus());
|
||||||
report.setId(scenarioReport.getId());
|
report.setId(scenarioReport.getId());
|
||||||
report.setTriggerMode(scenarioReport.getTriggerMode());
|
report.setTriggerMode(scenarioReport.getTriggerMode());
|
||||||
report.setName(scenarioReport.getName());
|
report.setName(scenarioReport.getName());
|
||||||
|
|
||||||
|
|
||||||
SystemParameterService systemParameterService = CommonBeanFactory.getBean(SystemParameterService.class);
|
SystemParameterService systemParameterService = CommonBeanFactory.getBean(SystemParameterService.class);
|
||||||
assert systemParameterService != null;
|
assert systemParameterService != null;
|
||||||
BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo();
|
BaseSystemConfigDTO baseSystemConfigDTO = systemParameterService.getBaseInfo();
|
||||||
reportUrl = baseSystemConfigDTO.getUrl() + "/#/api/automation/report";
|
reportUrl = baseSystemConfigDTO.getUrl() + "/#/api/automation/report";
|
||||||
|
|
||||||
|
|
||||||
String scenaName = scenarioReport.getName();
|
String scenaName = scenarioReport.getName();
|
||||||
if (scenaName == null) {
|
if (scenaName == null) {
|
||||||
scenaName = "";
|
scenaName = "";
|
||||||
|
} else {
|
||||||
|
String[] sceneNameArr = scenaName.split("-");
|
||||||
|
if (sceneNameArr.length >= 4) {
|
||||||
|
String endStr = "-" + sceneNameArr[sceneNameArr.length - 3] + "-" + sceneNameArr[sceneNameArr.length - 2] + "-" + sceneNameArr[sceneNameArr.length - 1];
|
||||||
|
scenaName = scenaName.split(endStr)[0];
|
||||||
} else {
|
} else {
|
||||||
scenaName = scenaName.split("-")[0];
|
scenaName = scenaName.split("-")[0];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String scenarioID = apiScenarioReportService.getApiScenarioId(scenaName, scenarioReport.getProjectId());
|
String scenarioID = apiScenarioReportService.getApiScenarioId(scenaName, scenarioReport.getProjectId());
|
||||||
testResult.setTestId(scenarioID);
|
testResult.setTestId(scenarioID);
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
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 reportDetail.content like concat('%"', scene.`name`,'"%')
|
INNER JOIN api_scenario scene ON report.scenario_id = scene.id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
@ -179,8 +179,8 @@
|
||||||
SELECT count(acr.report_id) AS countNumber FROM api_scenario_report_detail acr
|
SELECT count(acr.report_id) AS countNumber FROM api_scenario_report_detail acr
|
||||||
INNER JOIN api_scenario_report ar ON ar.id = acr.report_id
|
INNER JOIN api_scenario_report ar ON ar.id = acr.report_id
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT acitem.`name` FROM api_scenario acitem INNER JOIN `schedule` sc ON acitem.id = sc.resource_id
|
SELECT acitem.`name`,acitem.id FROM api_scenario acitem INNER JOIN `schedule` sc ON acitem.id = sc.resource_id
|
||||||
) ac on acr.content like CONCAT('%"', ac.`name`,'"%')
|
) ac on ar.scenario_id = ac.id
|
||||||
WHERE acr.project_id = #{projectId} AND ar.create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
|
WHERE acr.project_id = #{projectId} AND ar.create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -189,8 +189,8 @@
|
||||||
FROM api_scenario_report_detail acr
|
FROM api_scenario_report_detail acr
|
||||||
INNER JOIN api_scenario_report ar ON ar.id = acr.report_id
|
INNER JOIN api_scenario_report ar ON ar.id = acr.report_id
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT acitem.`name` FROM api_scenario acitem INNER JOIN `schedule` sc ON acitem.id = sc.resource_id
|
SELECT acitem.`name`,acitem.id FROM api_scenario acitem INNER JOIN `schedule` sc ON acitem.id = sc.resource_id
|
||||||
) ac on acr.content like CONCAT('%"', ac.`name`,'"%')
|
) ac on ar.scenario_id = ac.id
|
||||||
WHERE acr.project_id = #{projectId}
|
WHERE acr.project_id = #{projectId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -38,17 +38,17 @@
|
||||||
|
|
||||||
<select id="countTaskByProjectId" resultType="java.lang.Long">
|
<select id="countTaskByProjectId" resultType="java.lang.Long">
|
||||||
SELECT COUNT(id) AS countNumber FROM `schedule` WHERE resource_id IN (
|
SELECT COUNT(id) AS countNumber FROM `schedule` WHERE resource_id IN (
|
||||||
SELECT id FROM api_test WHERE project_id = #{0,jdbcType=VARCHAR}
|
SELECT id FROM api_test WHERE project_id = #{0,jdbcType=VARCHAR} AND status != 'Trash'
|
||||||
UNION
|
UNION
|
||||||
SELECT id FROM api_scenario WHERE project_id = #{0,jdbcType=VARCHAR}
|
SELECT id FROM api_scenario WHERE project_id = #{0,jdbcType=VARCHAR} AND status != 'Trash'
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
<select id="countTaskByProjectIdAndCreateTimeRange" resultType="java.lang.Long">
|
<select id="countTaskByProjectIdAndCreateTimeRange" resultType="java.lang.Long">
|
||||||
SELECT COUNT(id) AS countNumber FROM `schedule`
|
SELECT COUNT(id) AS countNumber FROM `schedule`
|
||||||
WHERE resource_id IN (
|
WHERE resource_id IN (
|
||||||
SELECT id FROM api_test WHERE project_id = #{projectId,jdbcType=VARCHAR}
|
SELECT id FROM api_test WHERE project_id = #{projectId,jdbcType=VARCHAR} AND status != 'Trash'
|
||||||
UNION
|
UNION
|
||||||
SELECT id FROM api_scenario WHERE project_id = #{projectId,jdbcType=VARCHAR}
|
SELECT id FROM api_scenario WHERE project_id = #{projectId,jdbcType=VARCHAR} AND status != 'Trash'
|
||||||
)
|
)
|
||||||
AND create_time BETWEEN #{startTime} and #{endTime}
|
AND create_time BETWEEN #{startTime} and #{endTime}
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue