From 9b3b86ce6ebd0999d522a92aed51fdd4be1fb214 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 18 Nov 2022 19:20:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DK8s=E6=89=A7=E8=A1=8C=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E6=9C=AA=E5=AD=98=E5=82=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/exec/engine/KubernetesTestEngine.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/engine/KubernetesTestEngine.java b/api-test/backend/src/main/java/io/metersphere/api/exec/engine/KubernetesTestEngine.java index b6857a3aa5..87c441941a 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/engine/KubernetesTestEngine.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/engine/KubernetesTestEngine.java @@ -4,6 +4,8 @@ import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.client.KubernetesClient; import io.metersphere.api.dto.definition.request.MsTestPlan; import io.metersphere.base.domain.TestResource; +import io.metersphere.commons.constants.ApiRunMode; +import io.metersphere.commons.constants.ExtendedParameter; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.JSON; import io.metersphere.commons.utils.LogUtil; @@ -59,6 +61,11 @@ public class KubernetesTestEngine extends AbstractEngine { String path = "api/start"; if (runRequest.getHashTree() != null) { path = "debug"; + if (runRequest.isDebug() && !StringUtils.equalsAny(runRequest.getRunMode(), ApiRunMode.DEFINITION.name())) { + runRequest.getExtendedParameters().put(ExtendedParameter.SAVE_RESULT, true); + } else if (!runRequest.isDebug()) { + runRequest.getExtendedParameters().put(ExtendedParameter.SAVE_RESULT, true); + } runRequest.setJmxScript(new MsTestPlan().getJmx(runRequest.getHashTree())); runRequest.setHashTree(null); LoggerUtil.info("进入DEBUG执行模式", runRequest.getReportId());