From 7b9209a33e3772ace26bb95237841cd135175db1 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Tue, 21 Feb 2023 19:54:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8C=E6=B5=8B=E8=AF=95=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=97=B6=E7=94=B1=E4=BA=8E=E6=A3=80=E6=9F=A5=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E7=AD=89=E5=8E=9F=E5=9B=A0=E6=8A=A5=E9=94=99=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E6=8A=A5=E5=91=8A=E6=9C=AA=E6=AD=A3=E5=B8=B8=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023540 --user=宋天阳 【测试跟踪】执行测试计划,包含没有环境的接口场景,和有问题的性能测试用例,不生成测试计划报告 https://www.tapd.cn/55049933/s/1340121 --- .../plan/service/TestPlanService.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java index 68d9352ed6..5a181c32db 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java @@ -889,24 +889,40 @@ public class TestPlanService { if (MapUtils.isNotEmpty(reportInfoDTO.getApiTestCaseDataMap())) { //执行接口案例任务 LoggerUtil.info("开始执行测试计划接口用例 " + planReportId); - apiCaseReportMap = this.executeApiTestCase(triggerMode, planReportId, userId, testPlanId, runModeConfig); + try { + apiCaseReportMap = this.executeApiTestCase(triggerMode, planReportId, userId, testPlanId, runModeConfig); + } catch (Exception e) { + LoggerUtil.info("测试报告" + planReportId + "本次执行测试计划接口用例失败! ", e); + } } if (MapUtils.isNotEmpty(reportInfoDTO.getPlanScenarioIdMap())) { //执行场景执行任务 LoggerUtil.info("开始执行测试计划场景用例 " + planReportId); - scenarioReportMap = this.executeScenarioCase(planReportId, testPlanId, projectId, runModeConfig, triggerMode, userId, reportInfoDTO.getPlanScenarioIdMap()); + try { + scenarioReportMap = this.executeScenarioCase(planReportId, testPlanId, projectId, runModeConfig, triggerMode, userId, reportInfoDTO.getPlanScenarioIdMap()); + } catch (Exception e) { + LoggerUtil.info("测试报告" + planReportId + "本次执行测试计划场景用例失败! ", e); + } } if (MapUtils.isNotEmpty(reportInfoDTO.getPerformanceIdMap())) { //执行性能测试任务 LoggerUtil.info("开始执行测试计划性能用例 " + planReportId); - loadCaseReportMap = perfExecService.executeLoadCase(planReportId, runModeConfig, transformationPerfTriggerMode(triggerMode), reportInfoDTO.getPerformanceIdMap()); + try { + loadCaseReportMap = perfExecService.executeLoadCase(planReportId, runModeConfig, transformationPerfTriggerMode(triggerMode), reportInfoDTO.getPerformanceIdMap()); + } catch (Exception e) { + LoggerUtil.info("测试报告" + planReportId + "本次执行测试计划性能用例失败! ", e); + } } if (reportInfoDTO.getUiScenarioIdMap() != null) { //执行UI场景执行任务 LoggerUtil.info("开始执行测试计划 UI 场景用例 " + planReportId); - uiScenarioReportMap = this.executeUiScenarioCase(planReportId, testPlanId, projectId, runModeConfig, triggerMode, userId, reportInfoDTO.getUiScenarioIdMap()); + try { + uiScenarioReportMap = this.executeUiScenarioCase(planReportId, testPlanId, projectId, runModeConfig, triggerMode, userId, reportInfoDTO.getUiScenarioIdMap()); + } catch (Exception e) { + LoggerUtil.info("测试报告" + planReportId + "本次执行测试计划 UI 用例失败! ", e); + } } LoggerUtil.info("开始生成测试计划报告内容 " + planReportId);