fix(测试跟踪): 修复实时报告查询接口用例资源池的方式
--bug=1024555 --user=宋天阳 【测试跟踪】计划中只有接口用例-执行计划选择k8s资源池-查看临时报告-资源池仍显示LOCAL https://www.tapd.cn/55049933/s/1353978
This commit is contained in:
parent
71f6913036
commit
77d176bd31
|
@ -63,6 +63,6 @@ public interface ExtTestPlanApiCaseMapper {
|
|||
|
||||
List<TestPlanApiCase> selectByRefIds(@Param("ids") List<String> ids);
|
||||
|
||||
List<String> selectResourcePoolIdByTestPlanApiIds(@Param("ids") List<String> resourceIds);
|
||||
List<String> selectResourcePoolIdByReportIds(@Param("ids") List<String> resourceIds);
|
||||
}
|
||||
|
||||
|
|
|
@ -556,15 +556,10 @@
|
|||
ORDER BY t.order DESC
|
||||
</select>
|
||||
|
||||
<select id="selectResourcePoolIdByTestPlanApiIds" resultType="java.lang.String">
|
||||
|
||||
SELECT DISTINCT actuator FROM api_definition_exec_result execResult
|
||||
INNER JOIN (
|
||||
SELECT id, resource_id, max( create_time + 0 ) AS create_time
|
||||
FROM api_definition_exec_result WHERE resource_id IN
|
||||
<foreach collection="ids" item="id" separator="," open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
) t ON execResult.id = t.id
|
||||
<select id="selectResourcePoolIdByReportIds" resultType="java.lang.String">
|
||||
SELECT DISTINCT actuator FROM api_definition_exec_result WHERE id IN
|
||||
<foreach collection="ids" item="id" separator="," open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -526,11 +526,13 @@ public class TestPlanApiCaseService {
|
|||
Map<String, List<String>> result = new LinkedHashMap<>();
|
||||
List<String> resourcePoolIds = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(resourceIds)) {
|
||||
List<String> reportIdList = new ArrayList<>();
|
||||
List<ApiDefinitionExecResultWithBLOBs> execResults = apiDefinitionExecResultService.selectByResourceIdsAndMaxCreateTime(resourceIds);
|
||||
Map<String, List<String>> projectConfigMap = new HashMap<>();
|
||||
execResults.forEach(item -> {
|
||||
String envConf = item.getEnvConfig();
|
||||
String projectId = item.getProjectId();
|
||||
reportIdList.add(item.getId());
|
||||
if (projectConfigMap.containsKey(projectId)) {
|
||||
projectConfigMap.get(projectId).add(envConf);
|
||||
} else {
|
||||
|
@ -540,7 +542,9 @@ public class TestPlanApiCaseService {
|
|||
}
|
||||
});
|
||||
result = apiDefinitionService.getProjectEnvNameByEnvConfig(projectConfigMap);
|
||||
resourcePoolIds = extTestPlanApiCaseMapper.selectResourcePoolIdByTestPlanApiIds(resourceIds);
|
||||
if (CollectionUtils.isNotEmpty(reportIdList)) {
|
||||
resourcePoolIds = extTestPlanApiCaseMapper.selectResourcePoolIdByReportIds(reportIdList);
|
||||
}
|
||||
}
|
||||
AutomationsRunInfoDTO returnDTO = new AutomationsRunInfoDTO();
|
||||
returnDTO.setProjectEnvMap(result);
|
||||
|
|
Loading…
Reference in New Issue