fix(测试计划): 修复测试计划进度条不准确
This commit is contained in:
parent
465fcc85c5
commit
b0ff13917c
|
@ -139,4 +139,8 @@ public class TestPlanLoadCaseService {
|
|||
testPlanLoadCaseMapper.updateByPrimaryKeySelective(testPlanLoadCase);
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getStatus(String planId) {
|
||||
return extTestPlanLoadCaseMapper.getStatusByTestPlanId(planId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -382,7 +382,17 @@ public class TestPlanService {
|
|||
}
|
||||
});
|
||||
|
||||
testPlan.setTotal(apiExecResults.size() + scenarioExecResults.size() + functionalExecResults.size());
|
||||
List<String> loadResults = testPlanLoadCaseService.getStatus(testPlan.getId());
|
||||
loadResults.forEach(item -> {
|
||||
if (StringUtils.isNotBlank(item)) {
|
||||
testPlan.setTested(testPlan.getTested() + 1);
|
||||
if (StringUtils.equals(item, "success")) {
|
||||
testPlan.setPassed(testPlan.getPassed() + 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
testPlan.setTotal(apiExecResults.size() + scenarioExecResults.size() + functionalExecResults.size() + loadResults.size());
|
||||
|
||||
testPlan.setPassRate(MathUtils.getPercentWithDecimal(testPlan.getTested() == 0 ? 0 : testPlan.getPassed() * 1.0 / testPlan.getTested()));
|
||||
testPlan.setTestRate(MathUtils.getPercentWithDecimal(testPlan.getTotal() == 0 ? 0 : testPlan.getTested() * 1.0 / testPlan.getTotal()));
|
||||
|
|
Loading…
Reference in New Issue