diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/environment/controller/TestEnvironmentController.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/environment/controller/TestEnvironmentController.java index 7c19be0572..bdb4fe6fef 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/environment/controller/TestEnvironmentController.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/environment/controller/TestEnvironmentController.java @@ -39,7 +39,6 @@ public class TestEnvironmentController { private BaseEnvGroupProjectService baseEnvGroupProjectService; @GetMapping("/list/{projectId}") - @RequiresPermissions("PROJECT_ENVIRONMENT:READ") public List list(@PathVariable String projectId) { return baseEnvironmentService.list(projectId); } @@ -53,21 +52,18 @@ public class TestEnvironmentController { * @return */ @PostMapping("/list/{goPage}/{pageSize}") - @RequiresPermissions("PROJECT_ENVIRONMENT:READ") public Pager> listByCondition(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody EnvironmentRequest environmentRequest) { Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, baseEnvironmentService.listByConditions(environmentRequest)); } @GetMapping("/get/{id}") - @RequiresPermissions("PROJECT_ENVIRONMENT:READ") public ApiTestEnvironmentWithBLOBs get(@PathVariable String id) { return baseEnvironmentService.get(id); } @PostMapping(value = "/get/entry") - @RequiresPermissions("PROJECT_ENVIRONMENT:READ") public List getEntry(@RequestPart("request") String password, @RequestPart(value = "file") MultipartFile sslFiles) { return commandService.get(password, sslFiles); } @@ -131,13 +127,11 @@ public class TestEnvironmentController { @GetMapping("/group/map/{groupId}") - @RequiresPermissions("PROJECT_ENVIRONMENT:READ") public Map getEnvMap(@PathVariable String groupId) { return baseEnvGroupProjectService.getEnvMap(groupId); } @GetMapping("/module/list/{projectId}/{protocol}") - @RequiresPermissions("PROJECT_ENVIRONMENT:READ") public List getNodeByProjectId(@PathVariable String projectId, @PathVariable String protocol) { return baseEnvironmentService.getNodeTreeByProjectId(projectId, protocol); } @@ -148,7 +142,6 @@ public class TestEnvironmentController { } @PostMapping("/database/validate") - @RequiresPermissions("PROJECT_ENVIRONMENT:READ") public void validate(@RequestBody DatabaseConfig databaseConfig) { try { DriverManager.getConnection(databaseConfig.getDbUrl(), databaseConfig.getUsername(), databaseConfig.getPassword()); diff --git a/performance-test/backend/src/main/java/io/metersphere/plan/service/PerfExecService.java b/performance-test/backend/src/main/java/io/metersphere/plan/service/PerfExecService.java index da7eb3ed0d..525b5efaa3 100644 --- a/performance-test/backend/src/main/java/io/metersphere/plan/service/PerfExecService.java +++ b/performance-test/backend/src/main/java/io/metersphere/plan/service/PerfExecService.java @@ -1,18 +1,17 @@ package io.metersphere.plan.service; import io.metersphere.base.mapper.ext.ExtLoadTestReportMapper; -import io.metersphere.commons.constants.ApiRunMode; import io.metersphere.commons.constants.ReportTriggerMode; import io.metersphere.constants.RunModeConstants; import io.metersphere.dto.RunModeConfigDTO; import io.metersphere.request.RunTestPlanRequest; import io.metersphere.utils.LoggerUtil; +import jakarta.annotation.Resource; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; import java.util.*; @Service @@ -56,10 +55,6 @@ public class PerfExecService { responseMap.put(k, reportId); }); - //将性能测试加入到队列中 - if (MapUtils.isNotEmpty(responseMap)) { - perfQueueService.add(responseMap, config.getResourcePoolId(), planReportId, config.getReportType(), config.getMode(), config); - } if (CollectionUtils.isEmpty(requests)) { return responseMap; } @@ -69,6 +64,11 @@ public class PerfExecService { } else { perfModeExecService.parallel(requests); } + + //将性能测试加入到队列中 + if (MapUtils.isNotEmpty(responseMap)) { + perfQueueService.add(responseMap, config.getResourcePoolId(), planReportId, config.getReportType(), config.getMode(), config); + } return responseMap; } } diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/remote/performance/PerfExecService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/remote/performance/PerfExecService.java index b2e7b475ae..94b1d2e153 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/remote/performance/PerfExecService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/remote/performance/PerfExecService.java @@ -1,5 +1,6 @@ package io.metersphere.plan.service.remote.performance; +import io.metersphere.constants.RunModeConstants; import io.metersphere.dto.RunModeConfigDTO; import io.metersphere.plan.request.performance.PlanPerformanceExecRequest; import org.springframework.stereotype.Service; @@ -21,6 +22,7 @@ public class PerfExecService extends LoadTestService { request.setConfig(runModeConfig); request.setTriggerMode(triggerMode); request.setPerfMap(performanceIdMap); + request.getConfig().setMode(RunModeConstants.PARALLEL.toString()); return this.run(request); } }