fix (测试跟踪): 修复测试计划场景批量执行选择资源池找不到环境问题

This commit is contained in:
fit2-zhao 2021-10-12 17:25:41 +08:00 committed by fit2-zhao
parent 2df546cfd0
commit 3fe9a65c9b
3 changed files with 16 additions and 4 deletions

View File

@ -155,9 +155,9 @@ public class JMeterService {
if (baseInfo != null) {
platformUrl = baseInfo.getUrl();
}
platformUrl += "/api/jmeter/download?testId=" + testId + "&reportId=" + reportId + "&testPlanScenarioId" + "&runMode=" + runMode;
platformUrl += "/api/jmeter/download?testId=" + testId + "&reportId=" + reportId + "&runMode=" + runMode;
if (StringUtils.isNotEmpty(testPlanScenarioId)) {
platformUrl += "=" + testPlanScenarioId;
platformUrl += "&testPlanScenarioId=" + testPlanScenarioId;
}
runRequest.setUrl(platformUrl);
runRequest.setRunMode(runMode);

View File

@ -1253,7 +1253,13 @@ public class ApiAutomationService {
for (String reportId : executeQueue.keySet()) {
if (request.getConfig() != null && StringUtils.isNotEmpty(request.getConfig().getResourcePoolId())) {
jMeterService.runTest(executeQueue.get(reportId).getTestId(), reportId, request.getRunMode(), request.getPlanScenarioId(), request.getConfig());
String testPlanScenarioId = "";
if (request.getScenarioTestPlanIdMap() != null && request.getScenarioTestPlanIdMap().containsKey(executeQueue.get(reportId).getTestId())) {
testPlanScenarioId = request.getScenarioTestPlanIdMap().get(executeQueue.get(reportId).getTestId());
} else {
testPlanScenarioId = request.getPlanScenarioId();
}
jMeterService.runTest(executeQueue.get(reportId).getTestId(), reportId, request.getRunMode(), testPlanScenarioId, request.getConfig());
} else {
jMeterService.runLocal(reportId, executeQueue.get(reportId).getHashTree(),
TriggerMode.BATCH.name().equals(request.getTriggerMode()) ? TriggerMode.BATCH.name() : request.getReportId(), request.getRunMode());

View File

@ -38,7 +38,13 @@ public class SerialScenarioExecTask<T> implements Callable<T> {
return null;
}
if (request.getConfig() != null && StringUtils.isNotBlank(request.getConfig().getResourcePoolId())) {
jMeterService.runTest(runModeDataDTO.getTestId(), runModeDataDTO.getReport().getId(), request.getRunMode(), request.getPlanScenarioId(), request.getConfig());
String testPlanScenarioId = "";
if (request.getScenarioTestPlanIdMap() != null && request.getScenarioTestPlanIdMap().containsKey(runModeDataDTO.getTestId())) {
testPlanScenarioId = request.getScenarioTestPlanIdMap().get(runModeDataDTO.getTestId());
} else {
testPlanScenarioId = request.getPlanScenarioId();
}
jMeterService.runTest(runModeDataDTO.getTestId(), runModeDataDTO.getReport().getId(), request.getRunMode(), testPlanScenarioId, request.getConfig());
} else {
jMeterService.runLocal(runModeDataDTO.getReport().getId(), runModeDataDTO.getHashTree(), TriggerMode.BATCH.name().equals(request.getTriggerMode()) ? TriggerMode.BATCH.name() : request.getReportId(), request.getRunMode());
}