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