fix(测试计划): 修复测试计划状态不准确

This commit is contained in:
shiziyuan9527 2021-01-25 16:50:36 +08:00
parent f09d1e7416
commit dc96a9affa
1 changed files with 10 additions and 0 deletions

View File

@ -104,6 +104,8 @@ public class TestPlanService {
private ExtTestPlanApiCaseMapper extTestPlanApiCaseMapper;
@Resource
private ExtTestPlanLoadCaseMapper extTestPlanLoadCaseMapper;
@Resource
private ExtTestPlanScenarioCaseMapper extTestPlanScenarioCaseMapper;
public synchronized void addTestPlan(AddTestPlanRequest testPlan) {
if (getTestPlanByName(testPlan.getName()).size() > 0) {
@ -602,6 +604,14 @@ public class TestPlanService {
}
}
// test-plan-scenario-case status
List<String> scenarioStatusList = extTestPlanScenarioCaseMapper.getExecResultByPlanId(planId);
for (String scenarioStatus : scenarioStatusList) {
if (scenarioStatus == null) {
return TestPlanStatus.Underway.name();
}
}
// test-plan-load-case status
List<String> loadStatusList = extTestPlanLoadCaseMapper.getStatusByTestPlanId(planId);
for (String loadStatus : loadStatusList) {