fix(测试计划报告): 修复测试计划没有自动更新进度的事情
--bug=1009863 --user=宋天阳 测试计划进度不自动更新 https://www.tapd.cn/55049933/s/1096437
This commit is contained in:
parent
bb737122fb
commit
c7175a220b
|
@ -63,7 +63,9 @@ public class MsThreadGroup extends MsTestElement {
|
||||||
boolean isConnScenarioPost = false;
|
boolean isConnScenarioPost = false;
|
||||||
//获取projectConfig
|
//获取projectConfig
|
||||||
String projectId = this.checkProjectId(hashTree);
|
String projectId = this.checkProjectId(hashTree);
|
||||||
this.checkEnvironmentConfig(projectId,config,hashTree);
|
if(StringUtils.isNotEmpty(projectId)){
|
||||||
|
this.checkEnvironmentConfig(projectId,config,hashTree);
|
||||||
|
}
|
||||||
if (config.getConfig() != null) {
|
if (config.getConfig() != null) {
|
||||||
if (config.isEffective(projectId)) {
|
if (config.isEffective(projectId)) {
|
||||||
EnvironmentConfig environmentConfig = config.getConfig().get(projectId);
|
EnvironmentConfig environmentConfig = config.getConfig().get(projectId);
|
||||||
|
|
|
@ -173,6 +173,7 @@ public class ApiScenarioSerialService {
|
||||||
MsThreadGroup group = new MsThreadGroup();
|
MsThreadGroup group = new MsThreadGroup();
|
||||||
group.setLabel(caseWithBLOBs.getName());
|
group.setLabel(caseWithBLOBs.getName());
|
||||||
group.setName(caseWithBLOBs.getName());
|
group.setName(caseWithBLOBs.getName());
|
||||||
|
group.setProjectId(caseWithBLOBs.getProjectId());
|
||||||
|
|
||||||
MsTestElement testElement = parse(caseWithBLOBs, testId, envId);
|
MsTestElement testElement = parse(caseWithBLOBs, testId, envId);
|
||||||
group.setHashTree(new LinkedList<>());
|
group.setHashTree(new LinkedList<>());
|
||||||
|
|
|
@ -228,6 +228,9 @@ public class ApiScenarioReportStructureService {
|
||||||
if (StringUtils.isNotEmpty(dto.getType()) && requests.contains(dto.getType()) && dto.getValue() == null) {
|
if (StringUtils.isNotEmpty(dto.getType()) && requests.contains(dto.getType()) && dto.getValue() == null) {
|
||||||
RequestResultExpandDTO requestResultExpandDTO = new RequestResultExpandDTO();
|
RequestResultExpandDTO requestResultExpandDTO = new RequestResultExpandDTO();
|
||||||
requestResultExpandDTO.setStatus("unexecute");
|
requestResultExpandDTO.setStatus("unexecute");
|
||||||
|
if(StringUtils.equalsAnyIgnoreCase(dto.getType(),"AbstractSampler")){
|
||||||
|
requestResultExpandDTO.setSuccess(true);
|
||||||
|
}
|
||||||
requestResultExpandDTO.setName(dto.getLabel());
|
requestResultExpandDTO.setName(dto.getLabel());
|
||||||
dto.setValue(requestResultExpandDTO);
|
dto.setValue(requestResultExpandDTO);
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,6 +279,7 @@
|
||||||
from
|
from
|
||||||
test_plan_api_case
|
test_plan_api_case
|
||||||
where test_plan_id = #{planId}
|
where test_plan_id = #{planId}
|
||||||
|
AND api_case_id in (SELECT id FROM api_test_case WHERE (`status` is null or `status` != 'Trash'))
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getIdsByPlanId" resultType="java.lang.String">
|
<select id="getIdsByPlanId" resultType="java.lang.String">
|
||||||
|
|
|
@ -176,6 +176,7 @@
|
||||||
from
|
from
|
||||||
test_plan_api_scenario
|
test_plan_api_scenario
|
||||||
where test_plan_id = #{planId}
|
where test_plan_id = #{planId}
|
||||||
|
AND api_scenario_id in (SELECT id FROM api_test_case WHERE (`status` is null or `status` != 'Trash'))
|
||||||
</select>
|
</select>
|
||||||
<select id="getIdsByPlanId" resultType="java.lang.String">
|
<select id="getIdsByPlanId" resultType="java.lang.String">
|
||||||
select id
|
select id
|
||||||
|
|
|
@ -277,18 +277,19 @@
|
||||||
inner join test_case on test_plan_test_case.case_id = test_case.id
|
inner join test_case on test_plan_test_case.case_id = test_case.id
|
||||||
left join test_case_node on test_case_node.id = test_case.node_id
|
left join test_case_node on test_case_node.id = test_case.node_id
|
||||||
inner join project on project.id = test_case.project_id
|
inner join project on project.id = test_case.project_id
|
||||||
left join project_version on project_version.id = test_case.version_id and project.id = project_version.project_id
|
left join project_version on project_version.id = test_case.version_id and project.id =
|
||||||
|
project_version.project_id
|
||||||
<include refid="queryWhereCondition"/>
|
<include refid="queryWhereCondition"/>
|
||||||
<if test="request.orders != null and request.orders.size() > 0">
|
<if test="request.orders != null and request.orders.size() > 0">
|
||||||
order by
|
order by
|
||||||
<foreach collection="request.orders" separator="," item="order">
|
<foreach collection="request.orders" separator="," item="order">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="order.name == 'custom_num'">
|
<when test="order.name == 'custom_num'">
|
||||||
customNum ${order.type}
|
customNum ${order.type}
|
||||||
</when>
|
</when>
|
||||||
<when test="order.name == 'name'">
|
<when test="order.name == 'name'">
|
||||||
test_case.name ${order.type}
|
test_case.name ${order.type}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
test_plan_test_case.${order.name} ${order.type}
|
test_plan_test_case.${order.name} ${order.type}
|
||||||
</otherwise>
|
</otherwise>
|
||||||
|
@ -418,6 +419,7 @@
|
||||||
select status
|
select status
|
||||||
from test_plan_test_case
|
from test_plan_test_case
|
||||||
where plan_id = #{planId}
|
where plan_id = #{planId}
|
||||||
|
AND case_id in (SELECT id FROM test_case WHERE (`status` is null or `status` != 'Trash'))
|
||||||
</select>
|
</select>
|
||||||
<select id="listByPlanId" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
<select id="listByPlanId" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||||
SELECT test_plan_api_case.id as reportId,test_plan_api_case.api_case_id as id,"definition" as
|
SELECT test_plan_api_case.id as reportId,test_plan_api_case.api_case_id as id,"definition" as
|
||||||
|
@ -473,15 +475,15 @@
|
||||||
|
|
||||||
<select id="listForMinder" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
<select id="listForMinder" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||||
select pc.id as id,
|
select pc.id as id,
|
||||||
pc.executor, pc.status,
|
pc.executor, pc.status,
|
||||||
pc.update_time,
|
pc.update_time,
|
||||||
pc.plan_id as planId,
|
pc.plan_id as planId,
|
||||||
t.name, t.priority,
|
t.name, t.priority,
|
||||||
t.type, t.node_id,
|
t.type, t.node_id,
|
||||||
t.steps, t.prerequisite,
|
t.steps, t.prerequisite,
|
||||||
t.remark,
|
t.remark,
|
||||||
t.id as caseId,
|
t.id as caseId,
|
||||||
t.node_path, t.method, t.num, t.step_model, t.expected_result, t.step_description
|
t.node_path, t.method, t.num, t.step_model, t.expected_result, t.step_description
|
||||||
from test_plan_test_case pc
|
from test_plan_test_case pc
|
||||||
inner join test_case t on pc.case_id = t.id
|
inner join test_case t on pc.case_id = t.id
|
||||||
<where>
|
<where>
|
||||||
|
@ -492,7 +494,9 @@
|
||||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
|
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
|
||||||
</select>
|
</select>
|
||||||
<select id="listTestCaseTest" resultType="io.metersphere.track.dto.TestCaseTestDTO">
|
<select id="listTestCaseTest" resultType="io.metersphere.track.dto.TestCaseTestDTO">
|
||||||
select * from test_case_test where test_case_id = #{caseId};
|
select *
|
||||||
|
from test_case_test
|
||||||
|
where test_case_id = #{caseId};
|
||||||
</select>
|
</select>
|
||||||
<select id="selectIdsByQuery" resultType="java.lang.String">
|
<select id="selectIdsByQuery" resultType="java.lang.String">
|
||||||
select test_plan_test_case.id
|
select test_plan_test_case.id
|
||||||
|
@ -504,21 +508,21 @@
|
||||||
<select id="selectForPlanReport" resultType="io.metersphere.track.dto.PlanReportCaseDTO">
|
<select id="selectForPlanReport" resultType="io.metersphere.track.dto.PlanReportCaseDTO">
|
||||||
select tptc.id, tptc.status
|
select tptc.id, tptc.status
|
||||||
from test_plan_test_case tptc
|
from test_plan_test_case tptc
|
||||||
inner join test_case tc
|
inner join test_case tc
|
||||||
on tc.id = tptc.case_id and tc.status != 'Trash'
|
on tc.id = tptc.case_id and tc.status != 'Trash'
|
||||||
where tptc.plan_id = #{planId};
|
where tptc.plan_id = #{planId};
|
||||||
</select>
|
</select>
|
||||||
<select id="getCases" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
<select id="getCases" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||||
select tptc.id, tc.id as caseId, tc.name, tc.priority, tc.num, tc.custom_num, tc.project_id,
|
select tptc.id, tc.id as caseId, tc.name, tc.priority, tc.num, tc.custom_num, tc.project_id,
|
||||||
tc.node_id, tc.tags, tptc.actual_result,
|
tc.node_id, tc.tags, tptc.actual_result,
|
||||||
tptc.update_time, tptc.create_time,
|
tptc.update_time, tptc.create_time,
|
||||||
tptc.issues_count, tptc.status,
|
tptc.issues_count, tptc.status,
|
||||||
tptc.plan_id, tptc.executor
|
tptc.plan_id, tptc.executor
|
||||||
from test_plan_test_case tptc
|
from test_plan_test_case tptc
|
||||||
inner join test_case tc on tptc.case_id = tc.id
|
inner join test_case tc on tptc.case_id = tc.id
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
and tptc.status = 'Failure'
|
and tptc.status = 'Failure'
|
||||||
</if>
|
</if>
|
||||||
and (tc.status != 'Trash' or tc.status is null)
|
and (tc.status != 'Trash' or tc.status is null)
|
||||||
where tptc.plan_id = #{planId} order by tptc.update_time desc
|
where tptc.plan_id = #{planId} order by tptc.update_time desc
|
||||||
</select>
|
</select>
|
||||||
|
@ -556,10 +560,14 @@
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectPlanIds" resultType="java.lang.String">
|
<select id="selectPlanIds" resultType="java.lang.String">
|
||||||
select DISTINCT plan_id from test_plan_test_case;
|
select DISTINCT plan_id
|
||||||
|
from test_plan_test_case;
|
||||||
</select>
|
</select>
|
||||||
<select id="getIdsOrderByUpdateTime" resultType="java.lang.String">
|
<select id="getIdsOrderByUpdateTime" resultType="java.lang.String">
|
||||||
select id from test_plan_test_case where plan_id = #{planId} order by update_time ASC;
|
select id
|
||||||
|
from test_plan_test_case
|
||||||
|
where plan_id = #{planId}
|
||||||
|
order by update_time ASC;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getLastOrder" resultType="java.lang.Long">
|
<select id="getLastOrder" resultType="java.lang.Long">
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
$t('api_test.home_page.detail_card.unexecute')
|
$t('api_test.home_page.detail_card.unexecute')
|
||||||
}}
|
}}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag size="mini" v-else-if="request.status && request.status==='unexecute'">{{
|
<el-tag size="mini" v-else-if="!request.success && request.status && request.status==='unexecute'">{{
|
||||||
$t('api_test.home_page.detail_card.unexecute')
|
$t('api_test.home_page.detail_card.unexecute')
|
||||||
}}
|
}}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
|
|
Loading…
Reference in New Issue