mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 03:58:33 +08:00
fix(接口测试): 修复接口测试报告统计时统计了全局前后置脚本的问题
修复接口测试报告统计时统计了全局前后置脚本的问题
This commit is contained in:
parent
dd711ca03b
commit
7c9388ee5a
@ -352,11 +352,16 @@ public class TestPlanScenarioCaseService {
|
||||
}
|
||||
}
|
||||
|
||||
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(JSON.toJSONString(map));
|
||||
testPlanApiScenario.setEnvironment(envJsonStr);
|
||||
mapper.updateByPrimaryKeyWithBLOBs(testPlanApiScenario);
|
||||
}
|
||||
}
|
||||
sqlSession.flushStatements();
|
||||
if (sqlSession != null && sqlSessionFactory != null) {
|
||||
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
|
||||
|
@ -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
Block a user