fix(测试跟踪): 只有性能用例的测试计划执行时不再记录执行按钮中选择的资源池,因为性能用例所需资源池是单独设置的

--bug=1025030 --user=宋天阳 【测试跟踪】手动执行测试计划-资源池为node-报告显示为node local
https://www.tapd.cn/55049933/s/1358637
This commit is contained in:
song-tianyang 2023-04-03 15:12:08 +08:00 committed by fit2-zhao
parent 307accb6e1
commit 60cf19b2f9
2 changed files with 17 additions and 8 deletions

View File

@ -339,7 +339,16 @@ public class TestPlanReportService {
returnDTO.setUiScenarioIdMap(uiScenarioIdMap);
}
if (testPlanReport == null) {
if (runInfoDTO != null && testPlanReport == null) {
if (!saveRequest.isApiCaseIsExecuting() && !saveRequest.isScenarioIsExecuting()) {
//如果没有接口用例以及场景运行执行配置中所选的资源池配置置空避免报告显示资源池时给用户造成困扰;
runModeConfigDTO.setResourcePoolId(null);
if (!saveRequest.isUiScenarioIsExecuting()) {
//如果也没有ui运行则运行环境也置空避免显示了没用到的环境给用户造成困扰
runInfoDTO.setRequestEnvMap(new HashMap<>());
}
}
runInfoDTO.setResourcePools(loadResourcePools);
if (StringUtils.isNotEmpty(runModeConfigDTO.getResourcePoolId())) {
if (!runInfoDTO.getResourcePools().contains(runModeConfigDTO.getResourcePoolId())) {
@ -1121,7 +1130,7 @@ public class TestPlanReportService {
}
public void initRunInformation(TestPlanReportDataStruct testPlanReportDTO, TestPlanReport testPlanReport) {
if (StringUtils.isNotEmpty(testPlanReport.getRunInfo())) {
if (ObjectUtils.isNotEmpty(testPlanReportDTO) && StringUtils.isNotEmpty(testPlanReport.getRunInfo())) {
try {
TestPlanReportRunInfoDTO runInfoDTO = JSON.parseObject(testPlanReport.getRunInfo(), TestPlanReportRunInfoDTO.class);
this.setEnvironmentToDTO(testPlanReportDTO, runInfoDTO);
@ -1198,7 +1207,9 @@ public class TestPlanReportService {
List<String> envNameList = new ArrayList<>();
for (String envId : envIdList) {
String envName = apiTestEnvironmentService.selectNameById(envId);
envNameList.add(envName);
if (StringUtils.isNoneBlank(envName)) {
envNameList.add(envName);
}
}
//考虑到存在不同工作空间下有相同名称的项目这里还是要检查一下项目名称是否已被记录
if (projectEnvMap.containsKey(projectName)) {

View File

@ -1456,6 +1456,8 @@ public class TestPlanService {
testPlanReport,
testPlan, testPlanExecuteReportDTO);
}
//查找运行环境
testPlanReportService.initRunInformation(testPlanReportStruct, testPlanReport);
}
return testPlanReportStruct == null ? new TestPlanReportDataStruct() : testPlanReportStruct;
}
@ -1635,11 +1637,7 @@ public class TestPlanService {
report.setName(testPlan.getName());
Project project = baseProjectService.getProjectById(testPlan.getProjectId());
if (project.getPlatform() != null && project.getPlatform().equals(IssuesManagePlatform.Local.name())) {
report.setIsThirdPartIssue(false);
} else {
report.setIsThirdPartIssue(true);
}
report.setIsThirdPartIssue(project.getPlatform() == null || !project.getPlatform().equals(IssuesManagePlatform.Local.name()));
}
return report;
}