From 9bde158b7e82b0a367d37cf163e5f71d25a9b1d1 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 25 Nov 2021 10:47:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(Jenkins=E6=89=A7=E8=A1=8C):=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0Jenkins=E6=89=A7=E8=A1=8C=E6=8E=A5=E5=8F=A3=E7=9A=84?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=A8=A1=E5=BC=8F=E5=8F=82=E6=95=B0=E5=8C=B9?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加Jenkins执行接口的运行模式参数匹配 --- .../io/metersphere/api/service/ApiJmeterFileService.java | 2 +- .../metersphere/track/service/TestPlanApiCaseService.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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 8e66039ea7..663b225f15 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiJmeterFileService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiJmeterFileService.java @@ -73,7 +73,7 @@ public class ApiJmeterFileService { } } HashTree hashTree; - if (StringUtils.equalsAnyIgnoreCase(runMode, ApiRunMode.DEFINITION.name(), ApiRunMode.API_PLAN.name(), ApiRunMode.SCHEDULE_API_PLAN.name(), ApiRunMode.MANUAL_PLAN.name())) { + if (StringUtils.equalsAnyIgnoreCase(runMode, ApiRunMode.DEFINITION.name(), ApiRunMode.JENKINS_API_PLAN.name(),ApiRunMode.API_PLAN.name(), ApiRunMode.SCHEDULE_API_PLAN.name(), ApiRunMode.MANUAL_PLAN.name())) { String testId = remoteTestId; if (remoteTestId.contains(":")) { //执行测试计划案例时会有拼接ID,ID为 planTestCaseId:测试计划报告ID diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java index 63389507d3..fcafb5c28f 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanApiCaseService.java @@ -391,7 +391,13 @@ public class TestPlanApiCaseService { if (caseWithBLOBs != null) { apiResult.setName(caseWithBLOBs.getName()); } - apiResult.setTriggerMode(TriggerMode.BATCH.name()); + if(StringUtils.equalsIgnoreCase(request.getTriggerMode(),ApiRunMode.SCHEDULE_API_PLAN.name())) { + apiResult.setTriggerMode(TriggerMode.SCHEDULE.name()); + }else if(StringUtils.equalsIgnoreCase(request.getTriggerMode(),ApiRunMode.JENKINS_API_PLAN.name())){ + apiResult.setTriggerMode(TriggerMode.MANUAL.name()); + }else { + apiResult.setTriggerMode(TriggerMode.BATCH.name()); + } apiResult.setActuator("LOCAL"); if (request.getConfig() != null && StringUtils.isNotEmpty(request.getConfig().getResourcePoolId())) { apiResult.setActuator(request.getConfig().getResourcePoolId());