revert: 回退"修复测试计划获取没有步骤结果场景时不会处理报告记录的问题"相关修改 (#8592)
* Revert "fix(测试计划): 修复测试计划获取没有步骤结果场景时不会处理报告记录的问题" This reverts commit08e27d3cc8
. * Revert "fix(测试计划): 修复测试计划获取没有步骤结果场景时不会处理报告记录的问题" This reverts commit75e678fc87
.
This commit is contained in:
parent
08e27d3cc8
commit
47617eea2d
|
@ -1481,7 +1481,7 @@ public class ApiAutomationService {
|
|||
String testId = executeQueue.get(reportId).getTestId();
|
||||
if (request.getScenarioTestPlanIdMap() != null && request.getScenarioTestPlanIdMap().containsKey(executeQueue.get(reportId).getTestId())) {
|
||||
testPlanScenarioId = executeQueue.get(reportId).getTestId();
|
||||
testId = reportId;
|
||||
testId = request.getScenarioTestPlanIdMap().get(executeQueue.get(reportId).getTestId());
|
||||
} else {
|
||||
testPlanScenarioId = request.getPlanScenarioId();
|
||||
}
|
||||
|
|
|
@ -292,13 +292,14 @@ public class ApiScenarioReportService {
|
|||
scenario.setExecuteTimes(executeTimes + 1);
|
||||
|
||||
apiScenarioMapper.updateByPrimaryKey(scenario);
|
||||
// 发送通知
|
||||
// sendNotice(scenario);
|
||||
}
|
||||
}
|
||||
returnReport = report;
|
||||
reportIds.add(report.getId());
|
||||
MessageCache.executionQueue.remove(report.getId());
|
||||
}
|
||||
counterPlanScenarioReport(result);
|
||||
return returnReport;
|
||||
}
|
||||
|
||||
|
@ -425,8 +426,6 @@ public class ApiScenarioReportService {
|
|||
LogUtil.error("未获取到场景报告。 报告ID:" + scenarioResult.getName() + "。 步骤信息:" + JSON.toJSONString(scenarioResult));
|
||||
}
|
||||
}
|
||||
// 针对未正常返回结果的报告计数
|
||||
counterPlanScenarioReport(result);
|
||||
testPlanLog.info("TestPlanReportId" + JSONArray.toJSONString(testPlanReportIdList) + " EXECUTE OVER. SCENARIO STATUS : " + JSONObject.toJSONString(scenarioAndErrorMap));
|
||||
for (String reportId : testPlanReportIdList) {
|
||||
TestPlanReportExecuteCatch.updateApiTestPlanExecuteInfo(reportId, null, scenarioAndErrorMap, null);
|
||||
|
@ -578,26 +577,6 @@ public class ApiScenarioReportService {
|
|||
}
|
||||
}
|
||||
|
||||
private void counterPlanScenarioReport(TestResult result) {
|
||||
if (CollectionUtils.isEmpty(result.getScenarios()) && StringUtils.isNotEmpty(result.getTestId())) {
|
||||
ApiScenarioReport report = apiScenarioReportMapper.selectByPrimaryKey(result.getTestId());
|
||||
if (report != null) {
|
||||
report.setStatus("Error");
|
||||
apiScenarioReportMapper.updateByPrimaryKey(report);
|
||||
MessageCache.scenarioExecResourceLock.remove(report.getId());
|
||||
MessageCache.executionQueue.remove(report.getId());
|
||||
if (StringUtils.equals(report.getExecuteType(), ExecuteType.Marge.name()) || StringUtils.equals(report.getScenarioId(), result.getSetReportId())) {
|
||||
Object obj = MessageCache.cache.get(result.getSetReportId());
|
||||
if (obj != null) {
|
||||
ReportCounter counter = (ReportCounter) obj;
|
||||
counter.getCompletedIds().add(report.getId());
|
||||
MessageCache.cache.put(result.getSetReportId(), counter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ApiScenarioReport updateScenario(TestResult result) {
|
||||
ApiScenarioReport lastReport = null;
|
||||
for (ScenarioResult item : result.getScenarios()) {
|
||||
|
|
|
@ -52,7 +52,7 @@ public class SerialScenarioExecTask<T> implements Callable<T> {
|
|||
}else {
|
||||
reportId = runModeDataDTO.getTestId();
|
||||
}
|
||||
jMeterService.runTest(runModeDataDTO.getReport().getId(), reportId, request.getRunMode(), testPlanScenarioId, request.getConfig());
|
||||
jMeterService.runTest(runModeDataDTO.getTestId(), reportId, request.getRunMode(), testPlanScenarioId, request.getConfig());
|
||||
} else {
|
||||
reportId = runModeDataDTO.getReport().getId();
|
||||
jMeterService.runLocal(runModeDataDTO.getReport().getId(),request.getConfig(), runModeDataDTO.getHashTree(), TriggerMode.BATCH.name().equals(request.getTriggerMode()) ? TriggerMode.BATCH.name() : request.getReportId(), request.getRunMode());
|
||||
|
|
Loading…
Reference in New Issue