From 2c29c35e8ae4c8d9cc6a1ac2d3f0b8a13e00fa73 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 23 Nov 2021 19:07:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=8E=AF=E5=A2=83=E7=BB=84):=20node?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=9C=BA=E6=99=AF=E4=BD=BF=E7=94=A8=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1008147 --user=lyh 【接口测试】场景定时任务执行没有使用环境组 https://www.tapd.cn/55049933/s/1073453 --- .../io/metersphere/api/service/ApiJmeterFileService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiJmeterFileService.java b/backend/src/main/java/io/metersphere/api/service/ApiJmeterFileService.java index 421c744fc2..308e381555 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiJmeterFileService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiJmeterFileService.java @@ -85,6 +85,14 @@ public class ApiJmeterFileService { if (item == null) { MSException.throwException("未找到执行场景。"); } + String envType = item.getEnvironmentType(); + String envJson = item.getEnvironmentJson(); + String envGroupId = item.getEnvironmentGroupId(); + if (StringUtils.equals(envType, EnvironmentType.JSON.name()) && StringUtils.isNotBlank(envJson)) { + planEnvMap = JSON.parseObject(envJson, Map.class); + } else if (StringUtils.equals(envType, EnvironmentType.GROUP.name()) && StringUtils.isNotBlank(envGroupId)) { + planEnvMap = environmentGroupProjectService.getEnvMap(envGroupId); + } hashTree = apiAutomationService.generateHashTree(item, reportId, planEnvMap); } return zipFilesToByteArray(remoteTestId, hashTree);