fix(测试跟踪): 修复执行测试计划时由于检查环境等原因报错导致的测试计划执行报告未正常生成的问题

--bug=1023540 --user=宋天阳 【测试跟踪】执行测试计划,包含没有环境的接口场景,和有问题的性能测试用例,不生成测试计划报告
https://www.tapd.cn/55049933/s/1340121
This commit is contained in:
song-tianyang 2023-02-21 19:54:43 +08:00 committed by CaptainB
parent ae4908ad39
commit 7b9209a33e
1 changed files with 20 additions and 4 deletions

View File

@ -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);