fix(Jenkins执行): 增加Jenkins执行接口的运行模式参数匹配

增加Jenkins执行接口的运行模式参数匹配
This commit is contained in:
song-tianyang 2021-11-25 10:47:10 +08:00 committed by song-tianyang
parent c0dd00c0f3
commit 9bde158b7e
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

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