fix(测试跟踪): 测试计划执行队列不再记录执行失败的性能用例
--bug=1027004 --user=宋天阳 【测试跟踪】测试计划-定时任务执行后状态一直是running,发现资源池显示的是错的。 https://www.tapd.cn/55049933/s/1381593
This commit is contained in:
parent
90ace2267c
commit
e5dda8d9a7
|
@ -39,7 +39,6 @@ public class TestEnvironmentController {
|
|||
private BaseEnvGroupProjectService baseEnvGroupProjectService;
|
||||
|
||||
@GetMapping("/list/{projectId}")
|
||||
@RequiresPermissions("PROJECT_ENVIRONMENT:READ")
|
||||
public List<ApiTestEnvironmentWithBLOBs> 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<List<ApiTestEnvironmentWithBLOBs>> listByCondition(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody EnvironmentRequest environmentRequest) {
|
||||
Page<Object> 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<KeyStoreEntry> 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<String, String> getEnvMap(@PathVariable String groupId) {
|
||||
return baseEnvGroupProjectService.getEnvMap(groupId);
|
||||
}
|
||||
|
||||
@GetMapping("/module/list/{projectId}/{protocol}")
|
||||
@RequiresPermissions("PROJECT_ENVIRONMENT:READ")
|
||||
public List<ApiModuleDTO> 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());
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue