From 96b84b46c70fe1f8a43d0e4ce4fd9f48598ce1da Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 9 Sep 2022 13:31:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8C=85=E5=90=AB=E5=90=8E=E7=BD=AE=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E9=80=89=E6=8B=A9node=E6=89=A7=E8=A1=8C=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1016665 --user=王孝刚 【测试跟踪】github#17752,接口带后置脚本,使用local资源池执行报错 https://www.tapd.cn/55049933/s/1241176 --- .../request/processors/post/MsJSR223PostProcessor.java | 2 -- .../io/metersphere/api/service/ApiExecutionQueueService.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJSR223PostProcessor.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJSR223PostProcessor.java index 3bc8ef51ce..fed64c668e 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJSR223PostProcessor.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/processors/post/MsJSR223PostProcessor.java @@ -6,7 +6,6 @@ import io.metersphere.api.dto.RunningParamKeys; import io.metersphere.api.dto.definition.request.ParameterConfig; import io.metersphere.api.dto.scenario.environment.EnvironmentConfig; import io.metersphere.api.dto.shell.filter.ScriptFilter; -import io.metersphere.commons.utils.SessionUtils; import io.metersphere.plugin.core.MsParameter; import io.metersphere.plugin.core.MsTestElement; import lombok.Data; @@ -88,7 +87,6 @@ public class MsJSR223PostProcessor extends MsTestElement { processor.setProperty("scriptLanguage", "rhino"); } processor.setProperty("script", this.getScript()); - processor.setProperty("projectId", StringUtils.isNotEmpty(this.getProjectId()) ? this.getProjectId() : SessionUtils.getCurrentProjectId()); final HashTree jsr223PostTree = tree.add(processor); if (CollectionUtils.isNotEmpty(hashTree)) { hashTree.forEach(el -> { diff --git a/backend/src/main/java/io/metersphere/api/service/ApiExecutionQueueService.java b/backend/src/main/java/io/metersphere/api/service/ApiExecutionQueueService.java index 8be24b716c..91b0bc03d8 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiExecutionQueueService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiExecutionQueueService.java @@ -157,7 +157,7 @@ public class ApiExecutionQueueService { queue.setRetryEnable(config.isRetryEnable()); queue.setRetryNumber(config.getRetryNum()); queue.setProjectIds(JSON.toJSONString(new ArrayList<>() {{ - runMap.get(k).getProjectId(); + this.add(runMap.get(k).getProjectId()); }})); queueDetails.add(queue); detailMap.put(k, queue.getId());