fix(接口测试): 修复K8s执行结果未存储问题

This commit is contained in:
fit2-zhao 2022-11-18 19:20:50 +08:00 committed by fit2-zhao
parent fe254b8e92
commit 9b3b86ce6e
1 changed files with 7 additions and 0 deletions

View File

@ -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());