fix(测试跟踪): 测试计划性能测试定时任务未执行
--bug=1012775 --user=李玉号 【测试跟踪】测试计划关联性能测试,设置定时任务,执行完没生成测试报告 https://www.tapd.cn/55049933/s/1148393
This commit is contained in:
parent
523911908c
commit
d5ae5e5899
|
@ -171,7 +171,7 @@ public class ApiScenarioImportUtil {
|
|||
|
||||
public static ApiDefinitionResult structureApiDefinitionByJson(int i,ApiDefinitionService apiDefinitionService,JSONObject object, String versionId, String projectId,ApiDefinitionMapper apiDefinitionMapper,Map<String,ApiDefinition>definitionMap) {
|
||||
ApiDefinitionResult test = new ApiDefinitionResult();
|
||||
apiDefinitionService.checkQuota();
|
||||
apiDefinitionService.checkQuota(projectId);
|
||||
String protocal = object.getString("protocal");
|
||||
if (StringUtils.equals(protocal, "DUBBO")) {
|
||||
test.setMethod("dubbo://");
|
||||
|
|
|
@ -236,7 +236,7 @@ public class ApiAutomationService {
|
|||
}
|
||||
|
||||
public ApiScenario create(SaveApiScenarioRequest request, List<MultipartFile> bodyFiles, List<MultipartFile> scenarioFiles) {
|
||||
checkQuota();
|
||||
checkQuota(request.getProjectId());
|
||||
request.setId(UUID.randomUUID().toString());
|
||||
if (request.getScenarioDefinition() == null) {
|
||||
MsScenario msScenario = new MsScenario();
|
||||
|
@ -272,10 +272,10 @@ public class ApiAutomationService {
|
|||
return scenario;
|
||||
}
|
||||
|
||||
private void checkQuota() {
|
||||
private void checkQuota(String projectId) {
|
||||
QuotaService quotaService = CommonBeanFactory.getBean(QuotaService.class);
|
||||
if (quotaService != null) {
|
||||
quotaService.checkAPIAutomationQuota();
|
||||
quotaService.checkAPIAutomationQuota(projectId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -316,7 +316,7 @@ public class ApiDefinitionService {
|
|||
}
|
||||
|
||||
public ApiDefinitionWithBLOBs create(SaveApiDefinitionRequest request, List<MultipartFile> bodyFiles) {
|
||||
checkQuota();
|
||||
checkQuota(request.getProjectId());
|
||||
if (StringUtils.equals(request.getProtocol(), "DUBBO")) {
|
||||
request.setMethod("dubbo://");
|
||||
}
|
||||
|
@ -345,10 +345,10 @@ public class ApiDefinitionService {
|
|||
return getBLOBs(returnModel.getId());
|
||||
}
|
||||
|
||||
public void checkQuota() {
|
||||
public void checkQuota(String projectId) {
|
||||
QuotaService quotaService = CommonBeanFactory.getBean(QuotaService.class);
|
||||
if (quotaService != null) {
|
||||
quotaService.checkAPIDefinitionQuota();
|
||||
quotaService.checkAPIDefinitionQuota(projectId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -536,6 +536,7 @@ public class PerformanceTestService {
|
|||
RunTestPlanRequest checkRequest = new RunTestPlanRequest();
|
||||
QuotaService quotaService = CommonBeanFactory.getBean(QuotaService.class);
|
||||
checkRequest.setLoadConfiguration(testReport.getLoadConfiguration());
|
||||
checkRequest.setProjectId(testReport.getProjectId());
|
||||
if (quotaService != null) {
|
||||
quotaService.checkLoadTestQuota(checkRequest, false);
|
||||
String projectId = testReport.getProjectId();
|
||||
|
|
|
@ -17,12 +17,12 @@ public interface QuotaService {
|
|||
/**
|
||||
* api配额检查
|
||||
*/
|
||||
void checkAPIDefinitionQuota();
|
||||
void checkAPIDefinitionQuota(String projectId);
|
||||
|
||||
/**
|
||||
* api配额检查
|
||||
*/
|
||||
void checkAPIAutomationQuota();
|
||||
void checkAPIAutomationQuota(String projectId);
|
||||
|
||||
/**
|
||||
* 性能测试配额检查
|
||||
|
|
Loading…
Reference in New Issue