mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-11-29 18:48:13 +08:00
fix(接口测试): 修复接口测试报告统计时统计了全局前后置脚本的问题
修复接口测试报告统计时统计了全局前后置脚本的问题
This commit is contained in:
parent
dd711ca03b
commit
7c9388ee5a
@ -351,11 +351,16 @@ public class TestPlanScenarioCaseService {
|
|||||||
map.put(s, envMap.get(s));
|
map.put(s, envMap.get(s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
testPlanApiScenario.setEnvironmentType(runModeConfig.getEnvironmentType());
|
String envJsonStr = JSON.toJSONString(map);
|
||||||
testPlanApiScenario.setEnvironmentGroupId(runModeConfig.getEnvironmentGroupId());
|
if (!StringUtils.equals(envJsonStr, testPlanApiScenario.getEnvironment())
|
||||||
testPlanApiScenario.setEnvironment(JSON.toJSONString(map));
|
|| !StringUtils.equals(runModeConfig.getEnvironmentType(), testPlanApiScenario.getEnvironmentType())
|
||||||
mapper.updateByPrimaryKeyWithBLOBs(testPlanApiScenario);
|
|| !StringUtils.equals(runModeConfig.getEnvironmentGroupId(), testPlanApiScenario.getEnvironmentGroupId())) {
|
||||||
|
testPlanApiScenario.setEnvironmentType(runModeConfig.getEnvironmentType());
|
||||||
|
testPlanApiScenario.setEnvironmentGroupId(runModeConfig.getEnvironmentGroupId());
|
||||||
|
testPlanApiScenario.setEnvironment(envJsonStr);
|
||||||
|
mapper.updateByPrimaryKeyWithBLOBs(testPlanApiScenario);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sqlSession.flushStatements();
|
sqlSession.flushStatements();
|
||||||
if (sqlSession != null && sqlSessionFactory != null) {
|
if (sqlSession != null && sqlSessionFactory != null) {
|
||||||
|
@ -567,6 +567,8 @@ public class ApiScenarioReportStructureService {
|
|||||||
if (CollectionUtils.isNotEmpty(reportStructureWithBLOBs) && CollectionUtils.isNotEmpty(reportResults)) {
|
if (CollectionUtils.isNotEmpty(reportStructureWithBLOBs) && CollectionUtils.isNotEmpty(reportResults)) {
|
||||||
ApiScenarioReportStructureWithBLOBs scenarioReportStructure = reportStructureWithBLOBs.get(0);
|
ApiScenarioReportStructureWithBLOBs scenarioReportStructure = reportStructureWithBLOBs.get(0);
|
||||||
List<StepTreeDTO> stepList = JSON.parseArray(new String(scenarioReportStructure.getResourceTree(), StandardCharsets.UTF_8), StepTreeDTO.class);
|
List<StepTreeDTO> stepList = JSON.parseArray(new String(scenarioReportStructure.getResourceTree(), StandardCharsets.UTF_8), StepTreeDTO.class);
|
||||||
|
//过滤掉前后置脚本。否则会影响到下面几行的统计数据。
|
||||||
|
reportResults = this.filterProcessResult(reportResults);
|
||||||
|
|
||||||
reportDTO.setTotal(reportResults.size());
|
reportDTO.setTotal(reportResults.size());
|
||||||
reportDTO.setError(reportResults.stream().filter(e -> StringUtils.equals(e.getStatus(), ApiReportStatus.ERROR.name())).collect(Collectors.toList()).size());
|
reportDTO.setError(reportResults.stream().filter(e -> StringUtils.equals(e.getStatus(), ApiReportStatus.ERROR.name())).collect(Collectors.toList()).size());
|
||||||
|
Loading…
Reference in New Issue
Block a user