fix(测试跟踪): 修复测试计划运行检查是否有可用行用例的缺陷 (#16498)
Co-authored-by: wxg0103 <727495428@qq.com>
This commit is contained in:
parent
18f6f0c480
commit
4afde03346
|
@ -21,7 +21,7 @@ public interface ExtTestPlanApiCaseMapper {
|
|||
|
||||
List<String> getIdsByPlanId(String planId);
|
||||
|
||||
List<String> getNotRelevanceCaseIds(@Param("planId")String planId, @Param("relevanceProjectIds")List<String> relevanceProjectIds);
|
||||
List<String> getNotRelevanceCaseIds(@Param("planId") String planId, @Param("relevanceProjectIds") List<String> relevanceProjectIds);
|
||||
|
||||
List<String> getStatusByTestPlanId(String id);
|
||||
|
||||
|
@ -37,17 +37,18 @@ public interface ExtTestPlanApiCaseMapper {
|
|||
|
||||
List<TestPlanFailureApiDTO> getFailureList(@Param("planId") String planId, @Param("status") String status);
|
||||
|
||||
List<TestPlanFailureApiDTO> getFailureListByIds(@Param("ids") Collection<String> caseIdList,@Param("status") String status);
|
||||
List<TestPlanFailureApiDTO> getFailureListByIds(@Param("ids") Collection<String> caseIdList, @Param("status") String status);
|
||||
|
||||
List<String> selectPlanIds();
|
||||
|
||||
List<String> getIdsOrderByUpdateTime(@Param("planId") String planId);
|
||||
|
||||
Long getPreOrder(@Param("planId")String planId, @Param("baseOrder") Long baseOrder);
|
||||
Long getPreOrder(@Param("planId") String planId, @Param("baseOrder") Long baseOrder);
|
||||
|
||||
Long getLastOrder(@Param("planId")String planId, @Param("baseOrder") Long baseOrder);
|
||||
Long getLastOrder(@Param("planId") String planId, @Param("baseOrder") Long baseOrder);
|
||||
|
||||
List<TestPlanApiCase> selectByIdsAndStatusIsNotTrash(@Param("ids") List<String> ids);
|
||||
|
||||
List<TestPlanApiCase> selectPlanByIdsAndStatusIsNotTrash(@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
|
|
|
@ -398,4 +398,17 @@
|
|||
#{v}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectPlanByIdsAndStatusIsNotTrash" resultType="io.metersphere.base.domain.TestPlanApiCase">
|
||||
SELECT
|
||||
plan.*
|
||||
FROM
|
||||
test_plan_api_case plan
|
||||
INNER JOIN api_test_case api ON plan.api_case_id = api.id
|
||||
WHERE
|
||||
(api.`status` is null OR api.`status` != 'Trash') AND plan.test_plan_id IN
|
||||
<foreach collection="ids" item="v" separator="," open="(" close=")">
|
||||
#{v}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -7,4 +7,7 @@ import java.util.List;
|
|||
|
||||
public interface ExtTestPlanApiScenarioMapper {
|
||||
public List<TestPlanApiScenario> selectByIdsAndStatusIsNotTrash(@Param("ids") List<String> ids);
|
||||
|
||||
List<TestPlanApiScenario> selectPlanByIdsAndStatusIsNotTrash(@Param("ids") List<String> ids);
|
||||
|
||||
}
|
||||
|
|
|
@ -13,4 +13,17 @@
|
|||
#{v}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectPlanByIdsAndStatusIsNotTrash"
|
||||
resultType="io.metersphere.base.domain.TestPlanApiScenario">
|
||||
SELECT
|
||||
plan.*
|
||||
FROM
|
||||
test_plan_api_scenario plan
|
||||
INNER JOIN api_scenario api ON plan.api_scenario_id = api.id
|
||||
WHERE
|
||||
(api.`status` is null OR api.`status` != 'Trash') AND plan.test_plan_id IN
|
||||
<foreach collection="ids" item="v" separator="," open="(" close=")">
|
||||
#{v}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.util.List;
|
|||
|
||||
public interface ExtTestPlanUiScenarioMapper {
|
||||
|
||||
List<TestPlanUiScenario> selectByIdsAndStatusIsNotTrash(@Param("ids") List<String> ids);
|
||||
List<TestPlanUiScenario> selectPlanByIdsAndStatusIsNotTrash(@Param("ids") List<String> ids);
|
||||
|
||||
|
||||
}
|
|
@ -3,14 +3,14 @@
|
|||
<mapper namespace="io.metersphere.base.mapper.ext.ExtTestPlanUiScenarioMapper">
|
||||
|
||||
|
||||
<select id="selectByIdsAndStatusIsNotTrash" resultType="io.metersphere.base.domain.TestPlanUiScenario">
|
||||
<select id="selectPlanByIdsAndStatusIsNotTrash" resultType="io.metersphere.base.domain.TestPlanUiScenario">
|
||||
SELECT
|
||||
plan.*
|
||||
FROM
|
||||
test_plan_ui_scenario plan
|
||||
INNER JOIN ui_scenario ui ON plan.ui_scenario_id = ui.id
|
||||
WHERE
|
||||
(ui.`status` is null OR ui.`status` != 'Trash') AND plan.id IN
|
||||
(ui.`status` is null OR ui.`status` != 'Trash') AND plan.test_plan_id IN
|
||||
<foreach collection="ids" item="v" separator="," open="(" close=")">
|
||||
#{v}
|
||||
</foreach>
|
||||
|
|
|
@ -2148,12 +2148,12 @@ public class TestPlanService {
|
|||
}
|
||||
List<String> ids = new ArrayList<>();
|
||||
ids.add(id);
|
||||
List<TestPlanApiCase> testPlanApiCases = extTestPlanApiCaseMapper.selectByIdsAndStatusIsNotTrash(ids);
|
||||
List<TestPlanApiCase> testPlanApiCases = extTestPlanApiCaseMapper.selectPlanByIdsAndStatusIsNotTrash(ids);
|
||||
if (!CollectionUtils.isEmpty(testPlanApiCases)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
List<TestPlanApiScenario> testPlanApiScenarios = extTestPlanApiScenarioMapper.selectByIdsAndStatusIsNotTrash(ids);
|
||||
List<TestPlanApiScenario> testPlanApiScenarios = extTestPlanApiScenarioMapper.selectPlanByIdsAndStatusIsNotTrash(ids);
|
||||
if (!CollectionUtils.isEmpty(testPlanApiScenarios)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -2407,7 +2407,7 @@ public class TestPlanService {
|
|||
|
||||
List<String> ids = new ArrayList<>();
|
||||
ids.add(id);
|
||||
List<TestPlanUiScenario> testPlanUiScenarios = extTestPlanUiScenarioMapper.selectByIdsAndStatusIsNotTrash(ids);
|
||||
List<TestPlanUiScenario> testPlanUiScenarios = extTestPlanUiScenarioMapper.selectPlanByIdsAndStatusIsNotTrash(ids);
|
||||
return !CollectionUtils.isEmpty(testPlanUiScenarios);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue