Merge branch 'main' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
179644acde
|
@ -8,6 +8,7 @@ import io.metersphere.api.dto.automation.TestPlanFailureApiDTO;
|
||||||
import io.metersphere.api.dto.definition.*;
|
import io.metersphere.api.dto.definition.*;
|
||||||
import io.metersphere.api.dto.plan.TestPlanApiCaseBatchRequest;
|
import io.metersphere.api.dto.plan.TestPlanApiCaseBatchRequest;
|
||||||
import io.metersphere.base.domain.ApiDefinitionExecResultWithBLOBs;
|
import io.metersphere.base.domain.ApiDefinitionExecResultWithBLOBs;
|
||||||
|
import io.metersphere.base.domain.ApiScenarioReportWithBLOBs;
|
||||||
import io.metersphere.commons.constants.OperLogConstants;
|
import io.metersphere.commons.constants.OperLogConstants;
|
||||||
import io.metersphere.commons.constants.OperLogModule;
|
import io.metersphere.commons.constants.OperLogModule;
|
||||||
import io.metersphere.commons.constants.PermissionConstants;
|
import io.metersphere.commons.constants.PermissionConstants;
|
||||||
|
@ -204,4 +205,10 @@ public class TestPlanApiCaseController {
|
||||||
public List<ApiDefinitionExecResultWithBLOBs> selectExtForPlanReport(@PathVariable("planId") String planId) {
|
public List<ApiDefinitionExecResultWithBLOBs> selectExtForPlanReport(@PathVariable("planId") String planId) {
|
||||||
return testPlanApiCaseService.selectExtForPlanReport(planId);
|
return testPlanApiCaseService.selectExtForPlanReport(planId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get/report/scenario/ext/{planId}")
|
||||||
|
public List<ApiScenarioReportWithBLOBs> selectExtForPlanScenarioReport(@PathVariable("planId") String planId) {
|
||||||
|
return testPlanApiCaseService.selectExtForPlanScenarioReport(planId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import io.metersphere.api.exec.api.ApiExecuteService;
|
||||||
import io.metersphere.api.jmeter.JMeterService;
|
import io.metersphere.api.jmeter.JMeterService;
|
||||||
import io.metersphere.base.domain.*;
|
import io.metersphere.base.domain.*;
|
||||||
import io.metersphere.base.mapper.ApiDefinitionExecResultMapper;
|
import io.metersphere.base.mapper.ApiDefinitionExecResultMapper;
|
||||||
|
import io.metersphere.base.mapper.ApiScenarioReportMapper;
|
||||||
import io.metersphere.base.mapper.ApiTestCaseMapper;
|
import io.metersphere.base.mapper.ApiTestCaseMapper;
|
||||||
import io.metersphere.base.mapper.ext.ExtApiDefinitionExecResultMapper;
|
import io.metersphere.base.mapper.ext.ExtApiDefinitionExecResultMapper;
|
||||||
import io.metersphere.base.mapper.plan.TestPlanApiCaseMapper;
|
import io.metersphere.base.mapper.plan.TestPlanApiCaseMapper;
|
||||||
|
@ -91,6 +92,8 @@ public class TestPlanApiCaseService {
|
||||||
private TestPlanService testPlanService;
|
private TestPlanService testPlanService;
|
||||||
@Resource
|
@Resource
|
||||||
private JMeterService jMeterService;
|
private JMeterService jMeterService;
|
||||||
|
@Resource
|
||||||
|
private ApiScenarioReportMapper apiScenarioReportMapper;
|
||||||
|
|
||||||
public List<TestPlanApiCaseDTO> list(ApiTestCaseRequest request) {
|
public List<TestPlanApiCaseDTO> list(ApiTestCaseRequest request) {
|
||||||
request.setProjectId(null);
|
request.setProjectId(null);
|
||||||
|
@ -818,6 +821,14 @@ public class TestPlanApiCaseService {
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ApiScenarioReportWithBLOBs> selectExtForPlanScenarioReport(String planId) {
|
||||||
|
ApiScenarioReportExample example = new ApiScenarioReportExample();
|
||||||
|
example.createCriteria().andRelevanceTestPlanReportIdEqualTo(planId);
|
||||||
|
List<ApiScenarioReportWithBLOBs> results = apiScenarioReportMapper.selectByExampleWithBLOBs(example);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<String> getApiCaseProjectIds(String planId) {
|
public List<String> getApiCaseProjectIds(String planId) {
|
||||||
TestPlanApiCaseExample caseExample = new TestPlanApiCaseExample();
|
TestPlanApiCaseExample caseExample = new TestPlanApiCaseExample();
|
||||||
caseExample.createCriteria().andTestPlanIdEqualTo(planId);
|
caseExample.createCriteria().andTestPlanIdEqualTo(planId);
|
||||||
|
|
|
@ -33,17 +33,6 @@ public class FileUtils {
|
||||||
public static final String ATTACHMENT_TMP_DIR = "/opt/metersphere/data/attachment/tmp";
|
public static final String ATTACHMENT_TMP_DIR = "/opt/metersphere/data/attachment/tmp";
|
||||||
|
|
||||||
public static void validateFileName(String fileName) {
|
public static void validateFileName(String fileName) {
|
||||||
if (StringUtils.isNotEmpty(fileName) && StringUtils.contains(fileName, File.separator)) {
|
|
||||||
MSException.throwException(Translator.get("invalid_parameter"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传Minio的文件名称检查只需要判断是否带有./ ../ 这样的非法文件名
|
|
||||||
*
|
|
||||||
* @param fileName
|
|
||||||
*/
|
|
||||||
public static void validateMinIOFileName(String fileName) {
|
|
||||||
if (StringUtils.isNotEmpty(fileName) && StringUtils.contains(fileName, "." + File.separator)) {
|
if (StringUtils.isNotEmpty(fileName) && StringUtils.contains(fileName, "." + File.separator)) {
|
||||||
MSException.throwException(Translator.get("invalid_parameter"));
|
MSException.throwException(Translator.get("invalid_parameter"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class MinIOFileRepository implements FileRepository {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String saveFile(MultipartFile file, FileRequest request) throws Exception {
|
public String saveFile(MultipartFile file, FileRequest request) throws Exception {
|
||||||
FileUtils.validateMinIOFileName(request.getFileName());
|
FileUtils.validateFileName(request.getFileName());
|
||||||
String bucket = minioProperties.getBucket();
|
String bucket = minioProperties.getBucket();
|
||||||
String fileName = request.getProjectId() + "/" + request.getFileName();
|
String fileName = request.getProjectId() + "/" + request.getFileName();
|
||||||
minioClient.putObject(PutObjectArgs.builder()
|
minioClient.putObject(PutObjectArgs.builder()
|
||||||
|
|
|
@ -199,4 +199,9 @@ public class TestPlanLoadCaseController {
|
||||||
testPlanLoadCaseService.buildLoadResponse(cases);
|
testPlanLoadCaseService.buildLoadResponse(cases);
|
||||||
return cases;
|
return cases;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/pool/{loadReportId}")
|
||||||
|
public String getPlanLoadCaseResourcePoolId(@PathVariable String loadReportId) {
|
||||||
|
return testPlanLoadCaseService.getPlanLoadCaseResourcePoolId(loadReportId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
import org.mybatis.spring.SqlSessionUtils;
|
import org.mybatis.spring.SqlSessionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -410,6 +411,17 @@ public class TestPlanLoadCaseService {
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPlanLoadCaseResourcePoolId(String loadReportId) {
|
||||||
|
if (StringUtils.isBlank(loadReportId)) {
|
||||||
|
return StringUtils.EMPTY;
|
||||||
|
}
|
||||||
|
LoadTestReportWithBLOBs loadCases = loadTestReportMapper.selectByPrimaryKey(loadReportId);
|
||||||
|
if (loadCases != null) {
|
||||||
|
return loadCases.getTestResourcePoolId();
|
||||||
|
}
|
||||||
|
return StringUtils.EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getAdvancedConfiguration(String loadCaseId) {
|
public String getAdvancedConfiguration(String loadCaseId) {
|
||||||
if (StringUtils.isBlank(loadCaseId)) {
|
if (StringUtils.isBlank(loadCaseId)) {
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package io.metersphere.plan.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PlanEnvConfig {
|
||||||
|
private String runMode;
|
||||||
|
}
|
|
@ -1400,4 +1400,100 @@ public class TestPlanReportService {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TestPlanSimpleReportDTO getReportOpt(String reportId) {
|
||||||
|
TestPlanReportContentExample example = new TestPlanReportContentExample();
|
||||||
|
example.createCriteria().andTestPlanReportIdEqualTo(reportId);
|
||||||
|
List<TestPlanReportContentWithBLOBs> testPlanReportContents = testPlanReportContentMapper.selectByExampleWithBLOBs(example);
|
||||||
|
if (CollectionUtils.isEmpty(testPlanReportContents)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
TestPlanReportContentWithBLOBs testPlanReportContent = testPlanReportContents.get(0);
|
||||||
|
if (testPlanReportContent == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (this.isDynamicallyGenerateReports(testPlanReportContent)) {
|
||||||
|
testPlanReportContent = this.dynamicallyGenerateReports(testPlanReportContent);
|
||||||
|
}
|
||||||
|
TestPlanSimpleReportDTO testPlanReportDTO = new TestPlanSimpleReportDTO();
|
||||||
|
BeanUtils.copyBean(testPlanReportDTO, testPlanReportContent);
|
||||||
|
this.generateEnvironmentInfo(testPlanReportDTO, reportId);
|
||||||
|
|
||||||
|
testPlanReportDTO.setFunctionResult(
|
||||||
|
getReportContentResultObject(testPlanReportContent.getFunctionResult(), TestPlanFunctionResultReportDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setApiResult(
|
||||||
|
getReportContentResultObject(testPlanReportContent.getApiResult(), TestPlanApiResultReportDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setLoadResult(
|
||||||
|
getReportContentResultObject(testPlanReportContent.getLoadResult(), TestPlanLoadResultReportDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setFunctionAllCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getFunctionAllCases(), TestPlanCaseDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setIssueList(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getIssueList(), IssuesDao.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setApiAllCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getApiAllCases(), TestPlanFailureApiDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setApiFailureCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getApiFailureCases(), TestPlanFailureApiDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setScenarioAllCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getScenarioAllCases(), TestPlanFailureScenarioDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setScenarioFailureCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getScenarioFailureCases(), TestPlanFailureScenarioDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setLoadAllCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getLoadAllCases(), TestPlanLoadCaseDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setLoadFailureCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getLoadFailureCases(), TestPlanLoadCaseDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setErrorReportCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getErrorReportCases(), TestPlanFailureApiDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setErrorReportScenarios(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getErrorReportScenarios(), TestPlanFailureScenarioDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setUnExecuteCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getUnExecuteCases(), TestPlanFailureApiDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setUnExecuteScenarios(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getUnExecuteScenarios(), TestPlanFailureScenarioDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setUiResult(
|
||||||
|
getReportContentResultObject(testPlanReportContent.getUiResult(), TestPlanUiResultReportDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setUiAllCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getUiAllCases(), TestPlanUiScenarioDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setUiFailureCases(
|
||||||
|
getReportContentResultArray(testPlanReportContent.getUiFailureCases(), TestPlanUiScenarioDTO.class)
|
||||||
|
);
|
||||||
|
|
||||||
|
testPlanReportDTO.setId(reportId);
|
||||||
|
TestPlanReport testPlanReport = testPlanReportMapper.selectByPrimaryKey(testPlanReportContent.getTestPlanReportId());
|
||||||
|
testPlanReportDTO.setName(testPlanReport.getName());
|
||||||
|
return testPlanReportDTO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,6 +156,8 @@ public class TestPlanService {
|
||||||
private SystemParameterService systemParameterService;
|
private SystemParameterService systemParameterService;
|
||||||
@Resource
|
@Resource
|
||||||
private BaseProjectApplicationService projectApplicationService;
|
private BaseProjectApplicationService projectApplicationService;
|
||||||
|
@Resource
|
||||||
|
private TestPlanReportMapper testPlanReportMapper;
|
||||||
public static final String POOL = "POOL";
|
public static final String POOL = "POOL";
|
||||||
|
|
||||||
public synchronized TestPlan addTestPlan(AddTestPlanRequest testPlan) {
|
public synchronized TestPlan addTestPlan(AddTestPlanRequest testPlan) {
|
||||||
|
@ -2013,6 +2015,13 @@ public class TestPlanService {
|
||||||
getResourcePool(apiDefinition.getActuator(), testPlanExtReportDTO);
|
getResourcePool(apiDefinition.getActuator(), testPlanExtReportDTO);
|
||||||
return testPlanExtReportDTO;
|
return testPlanExtReportDTO;
|
||||||
}
|
}
|
||||||
|
List<ApiScenarioReportWithBLOBs> apiScenarioLists = planTestPlanApiCaseService.selectExtForPlanScenarioReport(reportId);
|
||||||
|
if(CollectionUtils.isNotEmpty(apiScenarioLists)){
|
||||||
|
ApiScenarioReportWithBLOBs apiScenario = apiScenarioLists.get(0);
|
||||||
|
convertEnvConfig(apiScenario.getEnvConfig(), testPlanExtReportDTO);
|
||||||
|
getResourcePool(apiScenario.getActuator(), testPlanExtReportDTO);
|
||||||
|
return testPlanExtReportDTO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (serviceIdSet.contains(MicroServiceName.UI_TEST)) {
|
if (serviceIdSet.contains(MicroServiceName.UI_TEST)) {
|
||||||
List<UiScenarioReportWithBLOBs> apiDefinitionLists = planTestPlanUiScenarioCaseService.selectExtForPlanReport(reportId);
|
List<UiScenarioReportWithBLOBs> apiDefinitionLists = planTestPlanUiScenarioCaseService.selectExtForPlanReport(reportId);
|
||||||
|
@ -2023,6 +2032,25 @@ public class TestPlanService {
|
||||||
return testPlanExtReportDTO;
|
return testPlanExtReportDTO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (serviceIdSet.contains(MicroServiceName.PERFORMANCE_TEST)) {
|
||||||
|
TestPlanSimpleReportDTO testPlanSimpleReportDTO = testPlanReportService.getReportOpt(reportId);
|
||||||
|
if (testPlanSimpleReportDTO != null) {
|
||||||
|
List<TestPlanLoadCaseDTO> loadList = testPlanSimpleReportDTO.getLoadAllCases();
|
||||||
|
if (CollectionUtils.isNotEmpty(loadList)) {
|
||||||
|
String loadReportId = loadList.get(0).getLoadReportId();
|
||||||
|
if (StringUtils.isNotEmpty(loadReportId)) {
|
||||||
|
// 资源池
|
||||||
|
String planLoadCaseResourcePoolId = planTestPlanLoadCaseService.getPlanLoadCaseResourcePoolId(loadReportId);
|
||||||
|
// 运行模式
|
||||||
|
TestPlanReport testPlanReport = testPlanReportMapper.selectByPrimaryKey(reportId);
|
||||||
|
if (testPlanReport != null && StringUtils.isNotEmpty(testPlanReport.getRunInfo())) {
|
||||||
|
convertPlanEnvConfig(testPlanReport.getRunInfo(), testPlanExtReportDTO);
|
||||||
|
}
|
||||||
|
getResourcePool(planLoadCaseResourcePoolId, testPlanExtReportDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return testPlanExtReportDTO;
|
return testPlanExtReportDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2063,6 +2091,13 @@ public class TestPlanService {
|
||||||
getResourcePool(apiDefinition.getActuator(), testPlanExtReportDTO);
|
getResourcePool(apiDefinition.getActuator(), testPlanExtReportDTO);
|
||||||
return testPlanExtReportDTO;
|
return testPlanExtReportDTO;
|
||||||
}
|
}
|
||||||
|
List<ApiScenarioReportWithBLOBs> apiScenarioLists = planTestPlanApiCaseService.selectExtForPlanScenarioReport(reportId);
|
||||||
|
if(CollectionUtils.isNotEmpty(apiScenarioLists)){
|
||||||
|
ApiScenarioReportWithBLOBs apiScenario = apiScenarioLists.get(0);
|
||||||
|
convertEnvConfig(apiScenario.getEnvConfig(), testPlanExtReportDTO);
|
||||||
|
getResourcePool(apiScenario.getActuator(), testPlanExtReportDTO);
|
||||||
|
return testPlanExtReportDTO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (serviceIdSet.contains(MicroServiceName.UI_TEST)) {
|
if (serviceIdSet.contains(MicroServiceName.UI_TEST)) {
|
||||||
List<UiScenarioReportWithBLOBs> apiDefinitionLists = planTestPlanUiScenarioCaseService.selectExtForPlanReport(reportId);
|
List<UiScenarioReportWithBLOBs> apiDefinitionLists = planTestPlanUiScenarioCaseService.selectExtForPlanReport(reportId);
|
||||||
|
@ -2073,6 +2108,25 @@ public class TestPlanService {
|
||||||
return testPlanExtReportDTO;
|
return testPlanExtReportDTO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (serviceIdSet.contains(MicroServiceName.PERFORMANCE_TEST)) {
|
||||||
|
TestPlanSimpleReportDTO testPlanSimpleReportDTO = testPlanReportService.getReportOpt(reportId);
|
||||||
|
if (testPlanSimpleReportDTO != null) {
|
||||||
|
List<TestPlanLoadCaseDTO> loadList = testPlanSimpleReportDTO.getLoadAllCases();
|
||||||
|
if (CollectionUtils.isNotEmpty(loadList)) {
|
||||||
|
String loadReportId = loadList.get(0).getLoadReportId();
|
||||||
|
if (StringUtils.isNotEmpty(loadReportId)) {
|
||||||
|
// 资源池
|
||||||
|
String planLoadCaseResourcePoolId = planTestPlanLoadCaseService.getPlanLoadCaseResourcePoolId(loadReportId);
|
||||||
|
// 运行模式
|
||||||
|
TestPlanReport testPlanReport = testPlanReportMapper.selectByPrimaryKey(reportId);
|
||||||
|
if (testPlanReport != null && StringUtils.isNotEmpty(testPlanReport.getRunInfo())) {
|
||||||
|
convertPlanEnvConfig(testPlanReport.getRunInfo(), testPlanExtReportDTO);
|
||||||
|
}
|
||||||
|
getResourcePool(planLoadCaseResourcePoolId, testPlanExtReportDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return testPlanExtReportDTO;
|
return testPlanExtReportDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2088,4 +2142,18 @@ public class TestPlanService {
|
||||||
projectIds.addAll(apiScenarioProjectIds);
|
projectIds.addAll(apiScenarioProjectIds);
|
||||||
return projectIds.stream().distinct().collect(Collectors.toList());
|
return projectIds.stream().distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void convertPlanEnvConfig(String envConfig, TestPlanExtReportDTO testPlanExtReportDTO) throws JsonProcessingException {
|
||||||
|
if(StringUtils.isEmpty(envConfig)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PlanEnvConfig env = objectMapper.readValue(envConfig, PlanEnvConfig.class);
|
||||||
|
if(StringUtils.isNotEmpty(env.getRunMode())){
|
||||||
|
if(RunMode.RUN_MODE_SERIAL.getCode().equals(env.getRunMode())){
|
||||||
|
testPlanExtReportDTO.setRunMode(RunMode.RUN_MODE_SERIAL.getDesc());
|
||||||
|
} else if (RunMode.RUN_MODE_PARALLEL.getCode().equals(env.getRunMode())) {
|
||||||
|
testPlanExtReportDTO.setRunMode(RunMode.RUN_MODE_PARALLEL.getDesc());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package io.metersphere.plan.service.remote.api;
|
package io.metersphere.plan.service.remote.api;
|
||||||
|
|
||||||
import io.metersphere.base.domain.ApiDefinitionExecResultWithBLOBs;
|
import io.metersphere.base.domain.ApiDefinitionExecResultWithBLOBs;
|
||||||
|
import io.metersphere.base.domain.ApiScenarioReportWithBLOBs;
|
||||||
import io.metersphere.commons.constants.MicroServiceName;
|
import io.metersphere.commons.constants.MicroServiceName;
|
||||||
import io.metersphere.commons.exception.MSException;
|
import io.metersphere.commons.exception.MSException;
|
||||||
import io.metersphere.commons.utils.LogUtil;
|
import io.metersphere.commons.utils.LogUtil;
|
||||||
|
@ -166,4 +167,8 @@ public class PlanTestPlanApiCaseService extends ApiTestService {
|
||||||
public List<ApiDefinitionExecResultWithBLOBs> selectExtForPlanReport(String planId) {
|
public List<ApiDefinitionExecResultWithBLOBs> selectExtForPlanReport(String planId) {
|
||||||
return microService.getForDataArray(serviceName, BASE_UEL + "/get/report/ext/" + planId, ApiDefinitionExecResultWithBLOBs.class);
|
return microService.getForDataArray(serviceName, BASE_UEL + "/get/report/ext/" + planId, ApiDefinitionExecResultWithBLOBs.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ApiScenarioReportWithBLOBs> selectExtForPlanScenarioReport(String planId) {
|
||||||
|
return microService.getForDataArray(serviceName, BASE_UEL + "/get/report/scenario/ext/" + planId, ApiScenarioReportWithBLOBs.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,4 +129,9 @@ public class PlanTestPlanLoadCaseService extends LoadTestService {
|
||||||
request.setAllowedRepeatCase(testPlanService.isAllowedRepeatCase(request.getTestPlanId()));
|
request.setAllowedRepeatCase(testPlanService.isAllowedRepeatCase(request.getTestPlanId()));
|
||||||
return microService.postForData(serviceName, BASE_UEL + String.format("/relevance/list/%s/%s", pageNum, pageSize), request);
|
return microService.postForData(serviceName, BASE_UEL + String.format("/relevance/list/%s/%s", pageNum, pageSize), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPlanLoadCaseResourcePoolId(String loadReportId) {
|
||||||
|
return (String) microService.getForData(serviceName, BASE_UEL + "/pool/" + loadReportId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue