From c7175a220bc05c1c186eeed29282607b4f8977ae Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Sat, 22 Jan 2022 17:33:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=8A=A5=E5=91=8A):=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=B2=A1=E6=9C=89=E8=87=AA=E5=8A=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=BF=9B=E5=BA=A6=E7=9A=84=E4=BA=8B=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1009863 --user=宋天阳 测试计划进度不自动更新 https://www.tapd.cn/55049933/s/1096437 --- .../dto/definition/request/MsThreadGroup.java | 4 +- .../scenario/ApiScenarioSerialService.java | 1 + .../ApiScenarioReportStructureService.java | 3 + .../mapper/ext/ExtTestPlanApiCaseMapper.xml | 1 + .../ext/ExtTestPlanScenarioCaseMapper.xml | 1 + .../mapper/ext/ExtTestPlanTestCaseMapper.xml | 58 +++++++++++-------- .../report/components/RequestResult.vue | 2 +- 7 files changed, 43 insertions(+), 27 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsThreadGroup.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsThreadGroup.java index 4d9e3fdf3c..2c000f5134 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsThreadGroup.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsThreadGroup.java @@ -63,7 +63,9 @@ public class MsThreadGroup extends MsTestElement { boolean isConnScenarioPost = false; //获取projectConfig 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.isEffective(projectId)) { EnvironmentConfig environmentConfig = config.getConfig().get(projectId); diff --git a/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioSerialService.java b/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioSerialService.java index 94c2a2b572..d6ccb9c1bd 100644 --- a/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioSerialService.java +++ b/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioSerialService.java @@ -173,6 +173,7 @@ public class ApiScenarioSerialService { MsThreadGroup group = new MsThreadGroup(); group.setLabel(caseWithBLOBs.getName()); group.setName(caseWithBLOBs.getName()); + group.setProjectId(caseWithBLOBs.getProjectId()); MsTestElement testElement = parse(caseWithBLOBs, testId, envId); group.setHashTree(new LinkedList<>()); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java index 5117e8eb85..67011b650c 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportStructureService.java @@ -228,6 +228,9 @@ public class ApiScenarioReportStructureService { if (StringUtils.isNotEmpty(dto.getType()) && requests.contains(dto.getType()) && dto.getValue() == null) { RequestResultExpandDTO requestResultExpandDTO = new RequestResultExpandDTO(); requestResultExpandDTO.setStatus("unexecute"); + if(StringUtils.equalsAnyIgnoreCase(dto.getType(),"AbstractSampler")){ + requestResultExpandDTO.setSuccess(true); + } requestResultExpandDTO.setName(dto.getLabel()); dto.setValue(requestResultExpandDTO); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml index d599aa2d21..380c3dbf25 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml @@ -279,6 +279,7 @@ from test_plan_api_case where test_plan_id = #{planId} + AND api_case_id in (SELECT id FROM api_test_case WHERE (`status` is null or `status` != 'Trash')) select pc.id as id, - pc.executor, pc.status, - pc.update_time, - pc.plan_id as planId, - t.name, t.priority, - t.type, t.node_id, - t.steps, t.prerequisite, - t.remark, - t.id as caseId, - t.node_path, t.method, t.num, t.step_model, t.expected_result, t.step_description + pc.executor, pc.status, + pc.update_time, + pc.plan_id as planId, + t.name, t.priority, + t.type, t.node_id, + t.steps, t.prerequisite, + t.remark, + t.id as caseId, + t.node_path, t.method, t.num, t.step_model, t.expected_result, t.step_description from test_plan_test_case pc inner join test_case t on pc.case_id = t.id @@ -492,7 +494,9 @@ select tptc.id, tptc.status from test_plan_test_case tptc - inner join test_case tc - on tc.id = tptc.case_id and tc.status != 'Trash' + inner join test_case tc + on tc.id = tptc.case_id and tc.status != 'Trash' where tptc.plan_id = #{planId}; @@ -556,10 +560,14 @@