fix(测试跟踪): 测试计划执行结束时入库增加判断
--bug=1020347 --user=宋天阳 【接口测试】测试计划-失败停止-场景用例未执行状态显示的是waiting https://www.tapd.cn/55049933/s/1306376
This commit is contained in:
parent
07fe8670dc
commit
61302f291c
|
@ -530,11 +530,26 @@ public class TestPlanReportService {
|
|||
private void initTestPlanReportBaseCount(TestPlanReport testPlanReport, TestPlanReportContentWithBLOBs reportContent) {
|
||||
if(testPlanReport != null && reportContent != null){
|
||||
TestPlanReportBuildResultDTO reportBuildResultDTO = testPlanService.buildPlanReport(testPlanReport, reportContent);
|
||||
reportContent.setApiBaseCount(JSONObject.toJSONString(reportBuildResultDTO.getTestPlanSimpleReportDTO()));
|
||||
reportContent.setPassRate(reportBuildResultDTO.getTestPlanSimpleReportDTO().getPassRate());
|
||||
//如果场景报告中出现了 Waiting 或者 Running 则不保存
|
||||
boolean isReportAllFinished = this.checkAllReportFinished(reportBuildResultDTO.getTestPlanSimpleReportDTO());
|
||||
if(isReportAllFinished){
|
||||
reportContent.setApiBaseCount(JSONObject.toJSONString(reportBuildResultDTO.getTestPlanSimpleReportDTO()));
|
||||
reportContent.setPassRate(reportBuildResultDTO.getTestPlanSimpleReportDTO().getPassRate());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkAllReportFinished(TestPlanSimpleReportDTO testPlanSimpleReportDTO) {
|
||||
if(CollectionUtils.isNotEmpty(testPlanSimpleReportDTO.getScenarioAllCases())){
|
||||
for (TestPlanFailureScenarioDTO dto: testPlanSimpleReportDTO.getScenarioAllCases()) {
|
||||
if(StringUtils.equalsAnyIgnoreCase(dto.getLastResult(),"Waiting","Running")){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param planReportId 测试计划报告ID
|
||||
* @param resourceRunMode 资源的运行模式,triggerMode非Scedule可以为null
|
||||
|
|
Loading…
Reference in New Issue