diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/controller/ApiTaskCenterController.java b/backend/services/api-test/src/main/java/io/metersphere/api/controller/ApiTaskCenterController.java index f060677c47..5d1e0f6e63 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/controller/ApiTaskCenterController.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/controller/ApiTaskCenterController.java @@ -3,7 +3,9 @@ package io.metersphere.api.controller; import io.metersphere.api.service.ApiTaskCenterService; import io.metersphere.sdk.constants.PermissionConstants; import io.metersphere.system.dto.taskcenter.TaskCenterDTO; +import io.metersphere.system.dto.taskcenter.request.TaskCenterBatchRequest; import io.metersphere.system.dto.taskcenter.request.TaskCenterPageRequest; +import io.metersphere.system.log.constants.OperationLogModule; import io.metersphere.system.utils.Pager; import io.metersphere.system.utils.SessionUtils; import io.swagger.v3.oas.annotations.Operation; @@ -11,10 +13,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -34,7 +33,7 @@ public class ApiTaskCenterController { @PostMapping("/api/project/real-time/page") @Operation(summary = "项目-任务中心-接口用例/场景-实时任务列表") - @RequiresPermissions(PermissionConstants.SYSTEM_ORGANIZATION_PROJECT_READ) + @RequiresPermissions(PermissionConstants.PROJECT_API_REPORT_READ) public Pager> projectList(@Validated @RequestBody TaskCenterPageRequest request) { return apiTaskCenterService.getProjectPage(request, SessionUtils.getCurrentProjectId()); } @@ -53,4 +52,47 @@ public class ApiTaskCenterController { return apiTaskCenterService.getSystemPage(request); } + @PostMapping("/api/system/stop") + @Operation(summary = "系统-任务中心-接口用例/场景-停止任务") + @RequiresPermissions(PermissionConstants.SYSTEM_TASK_CENTER_READ) + public void systemStop(@Validated @RequestBody TaskCenterBatchRequest request) { + apiTaskCenterService.systemStop(request, SessionUtils.getUserId()); + } + + @PostMapping("/api/org/stop") + @Operation(summary = "组织-任务中心-接口用例/场景-停止任务") + @RequiresPermissions(PermissionConstants.ORGANIZATION_TASK_CENTER_READ_STOP) + public void orgStop(@Validated @RequestBody TaskCenterBatchRequest request) { + apiTaskCenterService.orgStop(request, SessionUtils.getCurrentOrganizationId(), SessionUtils.getUserId()); + } + + @PostMapping("/api/project/stop") + @Operation(summary = "项目-任务中心-接口用例/场景-停止任务") + @RequiresPermissions(PermissionConstants.PROJECT_API_REPORT_READ) + public void projectStop(@Validated @RequestBody TaskCenterBatchRequest request) { + apiTaskCenterService.projectStop(request, SessionUtils.getCurrentProjectId(), SessionUtils.getUserId()); + } + + @GetMapping("/api/project/stop/{id}") + @Operation(summary = "项目-任务中心-接口用例/场景-停止任务") + @RequiresPermissions(PermissionConstants.PROJECT_API_REPORT_READ) + public void stopById(@PathVariable String id) { + apiTaskCenterService.stopById(id, SessionUtils.getUserId(), OperationLogModule.PROJECT_MANAGEMENT_TASK_CENTER, "/task/center/api/project/stop"); + } + + @GetMapping("/api/org/stop/{id}") + @Operation(summary = "组织-任务中心-接口用例/场景-停止任务") + @RequiresPermissions(PermissionConstants.ORGANIZATION_TASK_CENTER_READ_STOP) + public void stopOrgById(@PathVariable String id) { + apiTaskCenterService.stopById(id, SessionUtils.getUserId(), OperationLogModule.SETTING_ORGANIZATION_TASK_CENTER, "/task/center/api/org/stop"); + } + + @GetMapping("/api/system/stop/{id}") + @Operation(summary = "系统-任务中心-接口用例/场景-停止任务") + @RequiresPermissions(PermissionConstants.PROJECT_API_REPORT_READ) + public void stopSystemById(@PathVariable String id) { + apiTaskCenterService.stopById(id, SessionUtils.getUserId(), OperationLogModule.SETTING_SYSTEM_TASK_CENTER, "/task/center/api/system/stop"); + } + + } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/report/ReportDTO.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/report/ReportDTO.java new file mode 100644 index 0000000000..93e2473bfc --- /dev/null +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/report/ReportDTO.java @@ -0,0 +1,26 @@ +package io.metersphere.api.dto.report; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +@Data +public class ReportDTO implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + + @Schema(description = "报告ID") + private String id; + @Schema(description = "资源池id") + private String poolId; + @Schema(description = "报告名称") + private String name; + @Schema(description = "项目id") + private String projectId; + @Schema(description = "组织id") + private String organizationId; + + +} diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.java b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.java index 6c8e6453c8..83a3a4d69f 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.java @@ -4,7 +4,9 @@ import io.metersphere.api.domain.ApiReport; import io.metersphere.api.dto.definition.ApiReportBatchRequest; import io.metersphere.api.dto.definition.ApiReportPageRequest; import io.metersphere.api.dto.definition.ApiReportStepDTO; +import io.metersphere.api.dto.report.ReportDTO; import io.metersphere.system.dto.taskcenter.TaskCenterDTO; +import io.metersphere.system.dto.taskcenter.request.TaskCenterBatchRequest; import io.metersphere.system.dto.taskcenter.request.TaskCenterPageRequest; import org.apache.ibatis.annotations.Param; @@ -25,6 +27,13 @@ public interface ExtApiReportMapper { int selectApiReportByTime(@Param("time") long time, @Param("projectId") String projectId); - List taskCenterlist(@Param("request") TaskCenterPageRequest request,@Param("projectIds") List projectIds); + List taskCenterlist(@Param("request") TaskCenterPageRequest request, @Param("projectIds") List projectIds, + @Param("startTime") long startTime, @Param("endTime") long endTime); + List getReports(@Param("request") TaskCenterBatchRequest request, @Param("projectIds") List projectIds, + @Param("ids") List ids, @Param("startTime") long startTime, @Param("endTime") long endTime); + + void updateReportStatus(@Param("ids") List ids, @Param("time") long time, @Param("userId") String userId); + + List selectByIds(@Param("ids") List ids); } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml index 55191e7e08..2fed21844b 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiReportMapper.xml @@ -1,6 +1,16 @@ + + update api_report + set status = 'STOPPED', + update_time = #{time}, + update_user = #{userId} + where id in + + #{id} + + - - - - - - - - and api_report.trigger_mode in - - - - + + diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.java b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.java index 9561287c76..f0c4f9d795 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.java @@ -7,8 +7,6 @@ import io.metersphere.project.dto.ModuleCountDTO; import io.metersphere.request.AssociateOtherCaseRequest; import io.metersphere.request.TestCasePageProviderRequest; import io.metersphere.system.dto.sdk.BaseTreeNode; -import io.metersphere.system.dto.taskcenter.TaskCenterDTO; -import io.metersphere.system.dto.taskcenter.request.TaskCenterPageRequest; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -32,8 +30,6 @@ public interface ExtApiScenarioMapper { Long getLastPos(@Param("projectId") String projectId); - List taskCenterlist(@Param("request") TaskCenterPageRequest request, @Param("projectIds") List projectIds); - List getAssociationPage(@Param("request") ApiScenarioAssociationPageRequest request); List getIdsByModules(@Param("request") ScenarioSystemRequest scenarioRequest); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.xml index 50a08d2170..276ceba6c9 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiScenarioMapper.xml @@ -379,44 +379,7 @@ LIMIT 1; - - - - - - - - and api_scenario_report.trigger_mode in - - - - - - - - select @@ -75,9 +85,7 @@ and api_scenario_report_detail.report_id = api_scenario_report_step.report_id where api_scenario_report_step.report_id = #{reportId} - + + + + + diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java index 69f76197bb..9ba55fa229 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTaskCenterService.java @@ -2,24 +2,40 @@ package io.metersphere.api.service; import com.github.pagehelper.Page; import com.github.pagehelper.page.PageMethod; +import io.metersphere.api.dto.report.ReportDTO; import io.metersphere.api.mapper.ExtApiReportMapper; -import io.metersphere.api.mapper.ExtApiScenarioMapper; +import io.metersphere.api.mapper.ExtApiScenarioReportMapper; import io.metersphere.project.domain.Project; import io.metersphere.project.mapper.ProjectMapper; +import io.metersphere.sdk.constants.HttpMethodConstants; import io.metersphere.sdk.constants.TaskCenterResourceType; import io.metersphere.sdk.exception.MSException; +import io.metersphere.sdk.util.DateUtils; +import io.metersphere.sdk.util.LogUtils; +import io.metersphere.sdk.util.SubListUtils; import io.metersphere.sdk.util.Translator; import io.metersphere.system.domain.Organization; +import io.metersphere.system.dto.builder.LogDTOBuilder; +import io.metersphere.system.dto.pool.TestResourceNodeDTO; +import io.metersphere.system.dto.pool.TestResourcePoolReturnDTO; import io.metersphere.system.dto.sdk.OptionDTO; import io.metersphere.system.dto.taskcenter.TaskCenterDTO; +import io.metersphere.system.dto.taskcenter.request.TaskCenterBatchRequest; import io.metersphere.system.dto.taskcenter.request.TaskCenterPageRequest; +import io.metersphere.system.log.constants.OperationLogModule; +import io.metersphere.system.log.constants.OperationLogType; +import io.metersphere.system.log.dto.LogDTO; +import io.metersphere.system.log.service.OperationLogService; import io.metersphere.system.mapper.BaseProjectMapper; import io.metersphere.system.mapper.ExtOrganizationMapper; import io.metersphere.system.mapper.OrganizationMapper; +import io.metersphere.system.service.TestResourcePoolService; import io.metersphere.system.service.UserLoginService; import io.metersphere.system.utils.PageUtils; import io.metersphere.system.utils.Pager; +import io.metersphere.system.utils.TaskRunnerClient; import jakarta.annotation.Resource; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -31,6 +47,8 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; +import static io.metersphere.api.controller.result.ApiResultCode.RESOURCE_POOL_EXECUTE_ERROR; + /** * @author: LAN * @date: 2024/1/17 11:24 @@ -43,9 +61,6 @@ public class ApiTaskCenterService { @Resource ExtApiReportMapper extApiReportMapper; - @Resource - ExtApiScenarioMapper extApiScenarioMapper; - @Resource ExtOrganizationMapper extOrganizationMapper; @@ -61,7 +76,18 @@ public class ApiTaskCenterService { @Resource OrganizationMapper organizationMapper; + @Resource + ExtApiScenarioReportMapper extApiScenarioReportMapper; + + @Resource + TestResourcePoolService testResourcePoolService; + @Resource + OperationLogService operationLogService; private static final String DEFAULT_SORT = "start_time desc"; + private final static String PROJECT_STOP = "/task/center/api/project/stop"; + private final static String ORG_STOP = "/task/center/api/org/stop"; + private final static String SYSTEM_STOP = "/task/center/api/system/stop"; + private final static String PROJECT_STOP_ID = "/task/center/api/project/stop"; /** * 任务中心实时任务列表-项目级 @@ -79,7 +105,7 @@ public class ApiTaskCenterService { * 任务中心实时任务列表-组织级 * * @param request 请求参数 - * @returnxx 任务中心实时任务列表 + * @return 任务中心实时任务列表 */ public Pager> getOrganizationPage(TaskCenterPageRequest request, String organizationId) { checkOrganizationExist(organizationId); @@ -109,9 +135,9 @@ public class ApiTaskCenterService { List projectIds = projectList.stream().map(OptionDTO::getId).toList(); if (request != null && !projectIds.isEmpty()) { if (request.getModuleType().equals(TaskCenterResourceType.API_CASE.toString())) { - list = extApiReportMapper.taskCenterlist(request, projectIds); + list = extApiReportMapper.taskCenterlist(request, projectIds, DateUtils.getDailyStartTime(), DateUtils.getDailyEndTime()); } else if (request.getModuleType().equals(TaskCenterResourceType.API_SCENARIO.toString())) { - list = extApiScenarioMapper.taskCenterlist(request, projectIds); + list = extApiScenarioReportMapper.taskCenterlist(request, projectIds, DateUtils.getDailyStartTime(), DateUtils.getDailyEndTime()); } processTaskCenter(list, projectList, projectIds); } @@ -179,4 +205,131 @@ public class ApiTaskCenterService { } } + public void systemStop(TaskCenterBatchRequest request, String userId) { + stopApiTask(request, null, userId, SYSTEM_STOP, HttpMethodConstants.POST.name(), OperationLogModule.SETTING_SYSTEM_TASK_CENTER); + } + + private void stopApiTask(TaskCenterBatchRequest request, List projectIds, String userId, String path, String method, String module) { + List reports = new ArrayList<>(); + if (request.getModuleType().equals(TaskCenterResourceType.API_CASE.toString())) { + if (request.isSelectAll()) { + reports = extApiReportMapper.getReports(request, projectIds, null, DateUtils.getDailyStartTime(), DateUtils.getDailyEndTime()); + } else { + reports = extApiReportMapper.getReports(request, projectIds, request.getSelectIds(), DateUtils.getDailyStartTime(), DateUtils.getDailyEndTime()); + } + } else if (request.getModuleType().equals(TaskCenterResourceType.API_SCENARIO.toString())) { + if (request.isSelectAll()) { + reports = extApiScenarioReportMapper.getReports(request, projectIds, null, DateUtils.getDailyStartTime(), DateUtils.getDailyEndTime()); + } else { + reports = extApiScenarioReportMapper.getReports(request, projectIds, request.getSelectIds(), DateUtils.getDailyStartTime(), DateUtils.getDailyEndTime()); + } + } + if (CollectionUtils.isNotEmpty(reports)) { + detailReport(request, reports, userId, path, method, module); + } + } + + private void detailReport(TaskCenterBatchRequest request, + List reports, + String userId, + String path, + String method, + String module) { + Map> poolIdMap = reports.stream() + .collect(Collectors.groupingBy(ReportDTO::getPoolId, Collectors.mapping(ReportDTO::getId, Collectors.toList()))); + + poolIdMap.forEach((poolId, reportList) -> { + TestResourcePoolReturnDTO testResourcePoolDTO = testResourcePoolService.getTestResourcePoolDetail(poolId); + List nodesList = testResourcePoolDTO.getTestResourceReturnDTO().getNodesList(); + if (CollectionUtils.isNotEmpty(nodesList)) { + stopTask(request, reportList, nodesList, userId, path, method, module); + } + }); + } + + public void stopTask(TaskCenterBatchRequest request, + List reportList, + List nodesList, + String userId, + String path, + String method, + String module) { + nodesList.forEach(node -> { + String endpoint = TaskRunnerClient.getEndpoint(node.getIp(), node.getPort()); + //需要去除取消勾选的report + if (CollectionUtils.isNotEmpty(request.getExcludeIds())) { + reportList.removeAll(request.getExcludeIds()); + } + SubListUtils.dealForSubList(reportList, 500, (subList) -> { + try { + LogUtils.info(String.format("开始发送停止请求到 %s 节点执行", endpoint), subList.toString()); + TaskRunnerClient.stopApi(endpoint, subList); + if (request.getModuleType().equals(TaskCenterResourceType.API_CASE.toString())) { + extApiReportMapper.updateReportStatus(subList, System.currentTimeMillis(), userId); + //记录日志 + saveLog(subList, userId, path, method, module, TaskCenterResourceType.API_CASE.toString()); + } else if (request.getModuleType().equals(TaskCenterResourceType.API_SCENARIO.toString())) { + extApiScenarioReportMapper.updateReportStatus(subList, System.currentTimeMillis(), userId); + saveLog(subList, userId, path, method, module, TaskCenterResourceType.API_SCENARIO.toString()); + } + + } catch (Exception e) { + LogUtils.error(e); + throw new MSException(RESOURCE_POOL_EXECUTE_ERROR, e.getMessage()); + } + }); + }); + } + + private void saveLog(List ids, String userId, String path, String method, String module, String type) { + List reports = new ArrayList<>(); + if (StringUtils.equals(type, TaskCenterResourceType.API_CASE.toString())) { + reports = extApiReportMapper.selectByIds(ids); + } else if (StringUtils.equals(type, TaskCenterResourceType.API_SCENARIO.toString())) { + reports = extApiScenarioReportMapper.selectByIds(ids); + } + //取出所有的项目id + List projectIds = reports.stream().map(ReportDTO::getProjectId).distinct().toList(); + //根据项目id取出组织id + List orgList = extApiScenarioReportMapper.getOrgListByProjectIds(projectIds); + //生成map key:项目id value:组织id + Map orgMap = orgList.stream().collect(Collectors.toMap(ReportDTO::getProjectId, ReportDTO::getOrganizationId)); + List logs = new ArrayList<>(); + reports.forEach(reportDTO -> { + LogDTO dto = LogDTOBuilder.builder() + .projectId(reportDTO.getProjectId()) + .organizationId(orgMap.get(reportDTO.getProjectId())) + .type(OperationLogType.UPDATE.name()) + .module(module) + .method(method) + .path(path) + .sourceId(reportDTO.getId()) + .content(String.format("停止任务:%s", reportDTO.getName())) + .createUser(userId) + .build().getLogDTO(); + logs.add(dto); + }); + operationLogService.batchAdd(logs); + } + + public void orgStop(TaskCenterBatchRequest request, String orgId, String userId) { + checkOrganizationExist(orgId); + List projectList = getOrgProjectList(orgId); + List projectIds = projectList.stream().map(OptionDTO::getId).toList(); + stopApiTask(request, projectIds, userId, ORG_STOP, HttpMethodConstants.POST.name(), OperationLogModule.SETTING_ORGANIZATION_TASK_CENTER); + + } + + public void projectStop(TaskCenterBatchRequest request, String currentProjectId, String userId) { + checkProjectExist(currentProjectId); + stopApiTask(request, List.of(currentProjectId), userId, PROJECT_STOP, HttpMethodConstants.POST.name(), OperationLogModule.PROJECT_MANAGEMENT_TASK_CENTER); + } + + public void stopById(String id, String userId, String module, String path) { + List reportIds = new ArrayList<>(); + reportIds.add(id); + TaskCenterBatchRequest request = new TaskCenterBatchRequest(); + request.setSelectIds(reportIds); + stopApiTask(request, null, userId, path, HttpMethodConstants.GET.name(), module); + } } diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiReportControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiReportControllerTests.java index 0226ca82cb..20833a6920 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiReportControllerTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiReportControllerTests.java @@ -12,7 +12,6 @@ import io.metersphere.api.dto.scenario.ApiScenarioDTO; import io.metersphere.api.dto.share.ShareInfoDTO; import io.metersphere.api.mapper.ApiReportDetailMapper; import io.metersphere.api.mapper.ApiReportMapper; -import io.metersphere.api.mapper.ApiReportStepMapper; import io.metersphere.api.service.definition.ApiReportService; import io.metersphere.api.utils.ApiDataUtils; import io.metersphere.project.domain.ProjectApplication; @@ -54,8 +53,6 @@ public class ApiReportControllerTests extends BaseTest { @Resource private ApiReportMapper apiReportMapper; @Resource - private ApiReportStepMapper apiReportStepMapper; - @Resource private ApiReportDetailMapper apiReportDetailMapper; @Resource private ShareInfoMapper shareInfoMapper; diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiScenarioReportControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiScenarioReportControllerTests.java index 3f9922000a..dd608b4b48 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiScenarioReportControllerTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiScenarioReportControllerTests.java @@ -13,7 +13,6 @@ import io.metersphere.api.dto.scenario.ApiScenarioReportDetailDTO; import io.metersphere.api.dto.share.ShareInfoDTO; import io.metersphere.api.mapper.ApiScenarioReportDetailMapper; import io.metersphere.api.mapper.ApiScenarioReportMapper; -import io.metersphere.api.mapper.ApiScenarioReportStepMapper; import io.metersphere.api.service.scenario.ApiScenarioReportService; import io.metersphere.api.utils.ApiDataUtils; import io.metersphere.project.domain.ProjectApplication; @@ -55,8 +54,6 @@ public class ApiScenarioReportControllerTests extends BaseTest { @Resource private ApiScenarioReportMapper apiScenarioReportMapper; @Resource - private ApiScenarioReportStepMapper apiScenarioReportStepMapper; - @Resource private ApiScenarioReportDetailMapper apiScenarioReportDetailMapper; @Resource private ShareInfoMapper shareInfoMapper; diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTaskCenterControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTaskCenterControllerTests.java index ed8ca119bd..576ef0a19f 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTaskCenterControllerTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiTaskCenterControllerTests.java @@ -1,14 +1,33 @@ package io.metersphere.api.controller; +import io.metersphere.api.domain.ApiReport; +import io.metersphere.api.domain.ApiScenarioReport; +import io.metersphere.api.service.BaseResourcePoolTestService; +import io.metersphere.api.service.definition.ApiReportService; +import io.metersphere.api.service.scenario.ApiScenarioReportService; +import io.metersphere.sdk.constants.ApiReportStatus; +import io.metersphere.sdk.constants.ResourcePoolTypeEnum; import io.metersphere.sdk.constants.SessionConstants; import io.metersphere.sdk.constants.TaskCenterResourceType; import io.metersphere.sdk.util.JSON; import io.metersphere.sdk.util.LogUtils; import io.metersphere.system.base.BaseTest; import io.metersphere.system.controller.handler.ResultHolder; +import io.metersphere.system.domain.TestResourcePoolBlob; +import io.metersphere.system.dto.pool.TestResourceDTO; +import io.metersphere.system.dto.pool.TestResourceNodeDTO; +import io.metersphere.system.dto.pool.TestResourcePoolDTO; +import io.metersphere.system.dto.sdk.BaseCondition; +import io.metersphere.system.dto.table.TableBatchProcessDTO; +import io.metersphere.system.dto.taskcenter.request.TaskCenterBatchRequest; import io.metersphere.system.dto.taskcenter.request.TaskCenterPageRequest; +import io.metersphere.system.mapper.TestResourcePoolBlobMapper; +import io.metersphere.system.mapper.TestResourcePoolMapper; import io.metersphere.system.utils.Pager; +import jakarta.annotation.Resource; +import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.*; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; @@ -19,6 +38,7 @@ import org.springframework.test.web.servlet.ResultMatcher; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -27,7 +47,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -@SpringBootTest(webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @AutoConfigureMockMvc public class ApiTaskCenterControllerTests extends BaseTest { @@ -36,9 +56,28 @@ public class ApiTaskCenterControllerTests extends BaseTest { private final static String REAL_TIME_PROJECT_PAGE = BASE_PATH + "project/real-time/page"; private final static String REAL_TIME_ORG_PAGE = BASE_PATH + "org/real-time/page"; private final static String REAL_TIME_SYSTEM_PAGE = BASE_PATH + "system/real-time/page"; + private final static String REAL_TIME_PROJECT_STOP = BASE_PATH + "project/stop"; + private final static String REAL_TIME_ORG_STOP = BASE_PATH + "org/stop"; + private final static String REAL_TIME_SYSTEM_STOP = BASE_PATH + "system/stop"; private static final ResultMatcher ERROR_REQUEST_MATCHER = status().is5xxServerError(); + @Resource + private ApiReportService apiReportService; + @Resource + private ApiScenarioReportService apiScenarioReportService; + @Resource + private TestResourcePoolMapper testResourcePoolMapper; + @Resource + private TestResourcePoolBlobMapper testResourcePoolBlobMapper; + @Resource + private BaseResourcePoolTestService baseResourcePoolTestService; + @Value("${embedded.mockserver.host}") + private String host; + @Value("${embedded.mockserver.port}") + private int port; + + @Test @Order(9) @Sql(scripts = {"/dml/init_api_definition.sql"}, config = @SqlConfig(encoding = "utf-8", transactionMode = SqlConfig.TransactionMode.ISOLATED)) @@ -69,7 +108,8 @@ public class ApiTaskCenterControllerTests extends BaseTest { switch (search) { case "KEYWORD" -> configureKeywordSearch(request); case "FILTER" -> configureFilterSearch(request); - default -> {} + default -> { + } } MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.post(url) .header(SessionConstants.HEADER_TOKEN, sessionId) @@ -136,4 +176,177 @@ public class ApiTaskCenterControllerTests extends BaseTest { } + @Test + @Order(11) + public void stop() throws Exception { + testInsertData(); + doStop("KEYWORD", REAL_TIME_PROJECT_STOP, TaskCenterResourceType.API_CASE.toString(), true); + doStop("FILTER", REAL_TIME_PROJECT_STOP, TaskCenterResourceType.API_CASE.toString(), false); + doStop("KEYWORD", REAL_TIME_ORG_STOP, TaskCenterResourceType.API_CASE.toString(), true); + doStop("FILTER", REAL_TIME_ORG_STOP, TaskCenterResourceType.API_CASE.toString(), false); + doStop("KEYWORD", REAL_TIME_SYSTEM_STOP, TaskCenterResourceType.API_CASE.toString(), true); + doStop("FILTER", REAL_TIME_SYSTEM_STOP, TaskCenterResourceType.API_CASE.toString(), false); + // scenario + doStop("KEYWORD", REAL_TIME_PROJECT_STOP, TaskCenterResourceType.API_SCENARIO.toString(), true); + doStop("FILTER", REAL_TIME_PROJECT_STOP, TaskCenterResourceType.API_SCENARIO.toString(), false); + doStop("KEYWORD", REAL_TIME_ORG_STOP, TaskCenterResourceType.API_SCENARIO.toString(), true); + doStop("FILTER", REAL_TIME_ORG_STOP, TaskCenterResourceType.API_SCENARIO.toString(), false); + doStop("KEYWORD", REAL_TIME_SYSTEM_STOP, TaskCenterResourceType.API_SCENARIO.toString(), true); + doStop("FILTER", REAL_TIME_SYSTEM_STOP, TaskCenterResourceType.API_SCENARIO.toString(), false); + + } + + @Test + @Order(12) + public void stopById() throws Exception { + mockPost("/api/stop", ""); + mockMvc.perform(MockMvcRequestBuilders.get("/task/center/api/project/stop/task-report-id0") + .header(SessionConstants.HEADER_TOKEN, sessionId) + .header(SessionConstants.CSRF_TOKEN, csrfToken) + .header(SessionConstants.CURRENT_PROJECT, DEFAULT_PROJECT_ID) + .header(SessionConstants.CURRENT_ORGANIZATION, DEFAULT_ORGANIZATION_ID)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); + mockPost("/api/stop", ""); + mockMvc.perform(MockMvcRequestBuilders.get("/task/center/api/org/stop/task-report-id0") + .header(SessionConstants.HEADER_TOKEN, sessionId) + .header(SessionConstants.CSRF_TOKEN, csrfToken) + .header(SessionConstants.CURRENT_PROJECT, DEFAULT_PROJECT_ID) + .header(SessionConstants.CURRENT_ORGANIZATION, DEFAULT_ORGANIZATION_ID)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); + mockMvc.perform(MockMvcRequestBuilders.get("/task/center/api/system/stop/task-report-id0") + .header(SessionConstants.HEADER_TOKEN, sessionId) + .header(SessionConstants.CSRF_TOKEN, csrfToken) + .header(SessionConstants.CURRENT_PROJECT, DEFAULT_PROJECT_ID) + .header(SessionConstants.CURRENT_ORGANIZATION, DEFAULT_ORGANIZATION_ID)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)).andReturn(); + } + + public void testInsertData() { + List reports = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + ApiReport apiReport = new ApiReport(); + apiReport.setId("task-report-id" + i); + apiReport.setProjectId(DEFAULT_PROJECT_ID); + apiReport.setName("task-report-name" + i); + apiReport.setStartTime(System.currentTimeMillis()); + apiReport.setResourceId("api-resource-id" + i); + apiReport.setCreateUser("admin"); + apiReport.setUpdateUser("admin"); + apiReport.setUpdateTime(System.currentTimeMillis()); + apiReport.setPoolId("api-pool-id"); + apiReport.setEnvironmentId("api-environment-id" + i); + apiReport.setRunMode("api-run-mode" + i); + if (i % 2 == 0) { + apiReport.setStatus(ApiReportStatus.PENDING.name()); + } else { + apiReport.setStatus(ApiReportStatus.RUNNING.name()); + } + apiReport.setTriggerMode("task-MANUAL"); + apiReport.setVersionId("api-version-id" + i); + reports.add(apiReport); + } + apiReportService.insertApiReport(reports); + + List scenarioReports = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + ApiScenarioReport scenarioReport = new ApiScenarioReport(); + scenarioReport.setId("task-report-id" + i); + scenarioReport.setProjectId(DEFAULT_PROJECT_ID); + scenarioReport.setName("task-report-name" + i); + scenarioReport.setStartTime(System.currentTimeMillis()); + scenarioReport.setScenarioId("scenario-scenario-id" + i); + scenarioReport.setCreateUser("admin"); + scenarioReport.setUpdateUser("admin"); + if (i % 2 == 0) { + scenarioReport.setStatus(ApiReportStatus.PENDING.name()); + } else { + scenarioReport.setStatus(ApiReportStatus.RUNNING.name()); + } + scenarioReport.setUpdateTime(System.currentTimeMillis()); + scenarioReport.setPoolId("api-pool-id"); + scenarioReport.setEnvironmentId("api-environment-id" + i); + scenarioReport.setRunMode("api-run-mode" + i); + scenarioReport.setTriggerMode("task-MANUAL"); + scenarioReport.setVersionId("api-version-id" + i); + scenarioReports.add(scenarioReport); + } + apiScenarioReportService.insertApiScenarioReport(scenarioReports); + + TestResourcePoolDTO testResourcePool = new TestResourcePoolDTO(); + testResourcePool.setId("api-pool-id"); + testResourcePool.setApiTest(true); + testResourcePool.setCreateTime(System.currentTimeMillis()); + testResourcePool.setUpdateTime(System.currentTimeMillis()); + testResourcePool.setDeleted(false); + testResourcePool.setName("api test"); + testResourcePool.setCreateUser("admin"); + testResourcePool.setAllOrg(true); + testResourcePool.setEnable(true); + testResourcePool.setType(ResourcePoolTypeEnum.NODE.name()); + TestResourcePoolBlob testResourcePoolBlob = new TestResourcePoolBlob(); + testResourcePoolBlob.setId("api-pool-id"); + TestResourceDTO testResourceDTO = new TestResourceDTO(); + TestResourceNodeDTO testResourceNodeDTO = new TestResourceNodeDTO(); + testResourceNodeDTO.setIp(host); + testResourceNodeDTO.setPort(port + StringUtils.EMPTY); + testResourceNodeDTO.setConcurrentNumber(10); + testResourceDTO.setNodesList(List.of(testResourceNodeDTO)); + String configuration = JSON.toJSONString(testResourceDTO); + testResourcePoolBlob.setConfiguration(configuration.getBytes()); + testResourcePool.setTestResourceDTO(testResourceDTO); + testResourcePoolMapper.insert(testResourcePool); + testResourcePoolBlobMapper.insert(testResourcePoolBlob); + + baseResourcePoolTestService.insertResourcePoolProject(testResourcePool); + baseResourcePoolTestService.insertProjectApplication(testResourcePool); + + } + + + private void doStop(String search, String url, String moduleType, boolean isSelectAll) throws Exception { + TaskCenterBatchRequest request = new TaskCenterBatchRequest(); + request.setModuleType(moduleType); + switch (search) { + case "KEYWORD" -> configureKeywordBatch(request); + case "FILTER" -> configureFilterBatch(request); + default -> { + } + } + if (isSelectAll) { + request.setSelectAll(true); + } else { + request.setSelectIds(List.of("task-report-id0", "task-report-id1")); + } + request.setExcludeIds(List.of("task-report-id3", "task-report-id4")); + + mockPost("/api/stop", ""); + mockMvc.perform(MockMvcRequestBuilders.post(url) + .header(SessionConstants.HEADER_TOKEN, sessionId) + .header(SessionConstants.CSRF_TOKEN, csrfToken) + .header(SessionConstants.CURRENT_PROJECT, DEFAULT_PROJECT_ID) + .header(SessionConstants.CURRENT_ORGANIZATION, DEFAULT_ORGANIZATION_ID) + .content(JSON.toJSONString(request)) + .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()).andReturn(); + } + + private void configureKeywordBatch(TaskCenterBatchRequest request) { + TableBatchProcessDTO batchProcessDTO = new TableBatchProcessDTO(); + BaseCondition condition = new BaseCondition(); + condition.setKeyword("task-report-name"); + batchProcessDTO.setCondition(condition); + request.setCondition(condition); + } + + private void configureFilterBatch(TaskCenterBatchRequest request) { + Map> filters = new HashMap<>(); + BaseCondition condition = new BaseCondition(); + filters.put("triggerMode", List.of("task-MANUAL")); + condition.setFilter(filters); + request.setCondition(condition); + } + + } diff --git a/backend/services/api-test/src/test/resources/dml/init_api_definition.sql b/backend/services/api-test/src/test/resources/dml/init_api_definition.sql index 3521e50527..0cff13569a 100644 --- a/backend/services/api-test/src/test/resources/dml/init_api_definition.sql +++ b/backend/services/api-test/src/test/resources/dml/init_api_definition.sql @@ -67,26 +67,26 @@ INSERT INTO `api_definition_mock_config` VALUES DELETE FROM `api_report` WHERE `id` in ('1', '2', '3', '4','5','6', '7', '8', '9','10','11', '12', '13', '14','15','16', '17', '18', '19','20'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('1', 'Test Report 1', '12df5721-c5e6-a38b-e999-3eafcb992094', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642000001, 1642001000, 1642002000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_1', b'0', '100001100001', 'env_1', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_1'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('10', 'Test Report 10', '12df5721-c5e6-a38b-e999-3eafcb992100', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642400101, 1642401100, 1642402100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_5', b'0', '100001100001', 'env_5', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_10'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('11', 'Test Report 11', '12df5721-c5e6-a38b-e999-3eafcb992233', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642500001, 1642501000, 1642502000, 1000, 'FAKE_ERROR', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_6', b'0', '100001100001', 'env_6', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_11'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('12', 'Test Report 12', '3ee2ae9c-a680-4ed6-b115-1f6ab8980100', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642500101, 1642501100, 1642502100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_6', b'0', '100001100001', 'env_6', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_12'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('13', 'Test Report 13', '3ee2ae9c-a680-4ed6-b115-1f6ab8980104', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642600001, 1642601000, 1642602000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_7', b'0', '100001100001', 'env_7', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_13'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('14', 'Test Report 14', '3ee2ae9c-a680-4ed6-b115-1f6ab8980545', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642600101, 1642601100, 1642602100, 1000, 'FAKE_ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_7', b'0', '100001100001', 'env_7', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_14'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('15', 'Test Report 15', '3ee2ae9c-a680-4ed6-b115-1f6ab8980553', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642700001, 1642701000, 1642702000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_8', b'0', '100001100001', 'env_8', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_15'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('16', 'Test Report 16', '3ee2ae9c-a680-4ed6-b115-1f6ab8980589', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642700101, 1642701100, 1642702100, 1000, 'SUCCESS', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_8', b'0', '100001100001', 'env_8', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_16'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('17', 'Test Report 17', '3ee2ae9c-a680-4ed6-b115-1f6ab8980973', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642800001, 1642801000, 1642802000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_9', b'0', '100001100001', 'env_9', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_17'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('18', 'Test Report 18', '12df5721-c5e6-a38b-e999-3eafcb992094', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642800101, 1642801100, 1642802100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_9', b'0', '100001100001', 'env_9', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_18'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('19', 'Test Report 19', '12df5721-c5e6-a38b-e999-3eafcb992100', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642900001, 1642901000, 1642902000, 1000, 'FAKE_ERROR', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_10', b'0', '100001100001', 'env_10', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_19'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('2', 'Test Report 2', '12df5721-c5e6-a38b-e999-3eafcb992233', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642000101, 1642001100, 1642002100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_1', b'0', '100001100001', 'env_1', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_2'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('20', 'Test Report 20', '3ee2ae9c-a680-4ed6-b115-1f6ab8980100', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642900101, 1642901100, 1642902100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_10', b'0', '100001100001', 'env_10', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_20'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('3', 'Test Report 3', '3ee2ae9c-a680-4ed6-b115-1f6ab8980104', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642100001, 1642101000, 1642102000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_2', b'0', '100001100001', 'env_2', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_3'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('4', 'Test Report 4', 'resource_4', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642100101, 1642101100, 1642102100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_2', b'1', '100001100001', 'env_2', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_4'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('5', 'Test Report 5', 'resource_5', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642200001, 1642201000, 1642202000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_3', b'1', '100001100001', 'env_3', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_5'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('6', 'Test Report 6', 'resource_6', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642200101, 1642201100, 1642202100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_3', b'1', '100001100001', 'env_3', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_6'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('7', 'Test Report 7', 'resource_7', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642300001, 1642301000, 1642302000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_4', b'1', '100001100001', 'env_4', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_7'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('8', 'Test Report 8', 'resource_8', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642300101, 1642301100, 1642302100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_4', b'1', '100001100001', 'env_4', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_8'); -INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('9', 'Test Report 9', 'resource_9', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642400001, 1642401000, 1642402000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_5', b'1', '100001100001', 'env_5', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_9'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('1', 'Test Report 1', '12df5721-c5e6-a38b-e999-3eafcb992094', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642000001, UNIX_TIMESTAMP() * 1000, 1642002000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_1', b'0', '100001100001', 'env_1', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_1'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('10', 'Test Report 10', '12df5721-c5e6-a38b-e999-3eafcb992100', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642400101, UNIX_TIMESTAMP() * 1000, 1642402100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_5', b'0', '100001100001', 'env_5', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_10'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('11', 'Test Report 11', '12df5721-c5e6-a38b-e999-3eafcb992233', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642500001, UNIX_TIMESTAMP() * 1000, 1642502000, 1000, 'FAKE_ERROR', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_6', b'0', '100001100001', 'env_6', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_11'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('12', 'Test Report 12', '3ee2ae9c-a680-4ed6-b115-1f6ab8980100', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642500101, UNIX_TIMESTAMP() * 1000, 1642502100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_6', b'0', '100001100001', 'env_6', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_12'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('13', 'Test Report 13', '3ee2ae9c-a680-4ed6-b115-1f6ab8980104', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642600001, UNIX_TIMESTAMP() * 1000, 1642602000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_7', b'0', '100001100001', 'env_7', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_13'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('14', 'Test Report 14', '3ee2ae9c-a680-4ed6-b115-1f6ab8980545', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642600101, UNIX_TIMESTAMP() * 1000, 1642602100, 1000, 'FAKE_ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_7', b'0', '100001100001', 'env_7', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_14'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('15', 'Test Report 15', '3ee2ae9c-a680-4ed6-b115-1f6ab8980553', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642700001, UNIX_TIMESTAMP() * 1000, 1642702000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_8', b'0', '100001100001', 'env_8', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_15'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('16', 'Test Report 16', '3ee2ae9c-a680-4ed6-b115-1f6ab8980589', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642700101, UNIX_TIMESTAMP() * 1000, 1642702100, 1000, 'SUCCESS', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_8', b'0', '100001100001', 'env_8', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_16'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('17', 'Test Report 17', '3ee2ae9c-a680-4ed6-b115-1f6ab8980973', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642800001, UNIX_TIMESTAMP() * 1000, 1642802000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_9', b'0', '100001100001', 'env_9', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_17'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('18', 'Test Report 18', '12df5721-c5e6-a38b-e999-3eafcb992094', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642800101, UNIX_TIMESTAMP() * 1000, 1642802100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_9', b'0', '100001100001', 'env_9', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_18'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('19', 'Test Report 19', '12df5721-c5e6-a38b-e999-3eafcb992100', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642900001, UNIX_TIMESTAMP() * 1000, 1642902000, 1000, 'FAKE_ERROR', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_10', b'0', '100001100001', 'env_10', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_19'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('2', 'Test Report 2', '12df5721-c5e6-a38b-e999-3eafcb992233', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642000101, UNIX_TIMESTAMP() * 1000, 1642002100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_1', b'0', '100001100001', 'env_1', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_2'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('20', 'Test Report 20', '3ee2ae9c-a680-4ed6-b115-1f6ab8980100', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642900101, UNIX_TIMESTAMP() * 1000, 1642902100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_10', b'0', '100001100001', 'env_10', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_20'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('3', 'Test Report 3', '3ee2ae9c-a680-4ed6-b115-1f6ab8980104', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642100001, UNIX_TIMESTAMP() * 1000, 1642102000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_2', b'0', '100001100001', 'env_2', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_3'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('4', 'Test Report 4', 'resource_4', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642100101, UNIX_TIMESTAMP() * 1000, 1642102100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_2', b'1', '100001100001', 'env_2', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_4'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('5', 'Test Report 5', 'resource_5', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642200001, UNIX_TIMESTAMP() * 1000, 1642202000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_3', b'1', '100001100001', 'env_3', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_5'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('6', 'Test Report 6', 'resource_6', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642200101, UNIX_TIMESTAMP() * 1000, 1642202100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_3', b'1', '100001100001', 'env_3', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_6'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('7', 'Test Report 7', 'resource_7', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642300001, UNIX_TIMESTAMP() * 1000, 1642302000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_4', b'1', '100001100001', 'env_4', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_7'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('8', 'Test Report 8', 'resource_8', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642300101, UNIX_TIMESTAMP() * 1000, 1642302100, 1000, 'ERROR', 'AUTOMATED', 'PARALLEL', '100660357777795313', 'version_4', b'1', '100001100001', 'env_4', 10, 5, 10, 85, 150, 145, '50%', '10%', '5%', '80%', '90%', 'script_8'); +INSERT INTO `api_report` (`id`, `name`, `resource_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('9', 'Test Report 9', 'resource_9', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1642400001, UNIX_TIMESTAMP() * 1000, 1642402000, 1000, 'SUCCESS', 'MANUAL', 'SEQUENTIAL', '100660357777795313', 'version_5', b'1', '100001100001', 'env_5', 0, 0, 0, 100, 150, 150, '50%', '10%', '5%', '80%', '90%', 'script_9'); DELETE FROM `test_resource_pool` WHERE `id` in ('100660357777795313'); INSERT INTO `test_resource_pool` (`id`, `name`, `type`, `description`, `enable`, `create_time`, `update_time`, `create_user`, `api_test`, `load_test`, `ui_test`, `server_url`, `all_org`, `deleted`) VALUES ('100660357777795313', 'LOCAL', 'Node', '测试资源池', b'1', 1705894549000, 1705894549000, 'admin', b'1', b'1', b'1', NULL, b'1', b'0'); @@ -103,26 +103,26 @@ INSERT INTO `api_scenario` (`id`, `name`, `priority`, `status`, `step_total`, `r INSERT INTO `api_scenario` (`id`, `name`, `priority`, `status`, `step_total`, `request_pass_rate`, `last_report_status`, `last_report_id`, `num`, `deleted`, `pos`, `version_id`, `ref_id`, `latest`, `project_id`, `module_id`, `description`, `tags`, `grouped`, `environment_id`, `create_user`, `create_time`, `delete_time`, `delete_user`, `update_user`, `update_time`) VALUES ('9', 'Scenario 9', 'P2', 'Not Planned', 16, 'Calculating', NULL, NULL, 1009, b'0', 9, 'version_9', 'ref_9', b'1', '100001100001', 'module_9', 'Description 9', '[\"tag1\",\"tag3\"]', b'1', 'env_5', 'admin', 1640772869000, NULL, NULL, 'admin', 1640772869000); DELETE FROM `api_scenario_report` WHERE `id` in ('report_1', 'report_2', 'report_3', 'report_4','report_5','report_6', 'report_7', 'report_8', 'report_9','report_10','report_11', 'report_12', 'report_13', 'report_14','report_15','report_16', 'report_17', 'report_18', 'report_19','report_20'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_1', 'Report 1', '1', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773000000, 1640773000000, 1640774000000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_1', b'0', '100001100001', 'env_1', 2, 0, 0, 2, 20, 18, '95%', 'Calculating', 'Calculating', '90%', '90%', 'script_1'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_10', 'Report 10', '3', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773900000, 1640773900000, 1640774900000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_10', b'0', '100001100001', 'env_10', 2, 0, 0, 2, 22, 20, '90%', 'Calculating', 'Calculating', '85%', '80%', 'script_10'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_11', 'Report 11', '4', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774000000, 1640774000000, 1640775000000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_11', b'0', '100001100001', 'env_11', 3, 1, 0, 2, 28, 26, '75%', 'Calculating', 'Calculating', '80%', '85%', 'script_11'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_12', 'Report 12', '5', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774100000, 1640774100000, 1640775100000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_12', b'1', '100001100001', 'env_12', 0, 0, 16, 16, 26, 24, 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_12'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_13', 'Report 13', '6', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774200000, 1640774200000, 1640775200000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_13', b'0', '100001100001', 'env_13', 2, 0, 0, 2, 24, 22, '80%', 'Calculating', 'Calculating', '85%', '90%', 'script_13'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_14', 'Report 14', '7', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774300000, 1640774300000, 1640775300000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_14', b'0', '100001100001', 'env_14', 3, 1, 0, 2, 20, 18, '70%', 'Calculating', 'Calculating', '75%', '80%', 'script_14'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_15', 'Report 15', '8', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774400000, 1640774400000, 1640775400000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_15', b'1', '100001100001', 'env_15', 0, 0, 18, 18, 22, 20, 'Calculating','Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_15'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_16', 'Report 16', '3', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774500000, 1640774500000, 1640775500000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_16', b'0', '100001100001', 'env_16', 2, 0, 0, 2, 20, 18, '85%', 'Calculating', 'Calculating', '90%', '90%', 'script_16'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_17', 'Report 17', '4', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774600000, 1640774600000, 1640775600000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_17', b'0', '100001100001', 'env_17', 3, 1, 0, 2, 26, 24, '75%', 'Calculating', 'Calculating', '80%', '85%', 'script_17'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_18', 'Report 18', '5', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774700000, 1640774700000, 1640775700000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_18', b'1', '100001100001', 'env_18', 0, 0, 20, 20, 30, 28, 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_18'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_19', 'Report 19', '6', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774800000, 1640774800000, 1640775800000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_19', b'0', '100001100001', 'env_19', 2, 0, 0, 2, 18, 16, '90%', 'Calculating', 'Calculating', '85%', '80%', 'script_19'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_2', 'Report 2', '2', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773100000, 1640773100000, 1640774100000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_2', b'0', '100001100001', 'env_2', 3, 1, 0, 2, 22, 20, '80%', 'Calculating', 'Calculating', '85%', '90%', 'script_2'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_20', 'Report 20', '2', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774900000, 1640774900000, 1640775900000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_20', b'0', '100001100001', 'env_20', 3, 1, 0, 2, 22, 20, '70%', 'Calculating', 'Calculating', '75%', '80%', 'script_20'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_3', 'Report 3', '3', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773200000, 1640773200000, 1640774200000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_3', b'1', '100001100001', 'env_3', 0, 0, 10, 10, 30, 28, 'Calculating','Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_3'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_4', 'Report 4', '4', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773300000, 1640773300000, 1640774300000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_4', b'0', '100001100001', 'env_4', 2, 0, 0, 2, 18, 16, '90%','Calculating', 'Calculating', '85%', '80%', 'script_4'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_5', 'Report 5', '5', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773400000, 1640773400000, 1640774400000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_5', b'0', '100001100001', 'env_5', 3, 1, 0, 2, 24, 22, '70%', 'Calculating', 'Calculating', '75%', '80%', 'script_5'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_6', 'Report 6', '6', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773500000, 1640773500000, 1640774500000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_6', b'1', '100001100001', 'env_6', 0, 0, 12, 12, 20, 18, 'Calculating','Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_6'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_7', 'Report 7', '7', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773600000, 1640773600000, 1640774600000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_7', b'0', '100001100001', 'env_7', 2, 0, 0, 2, 16, 14, '85%', 'Calculating', 'Calculating', '90%', '90%', 'script_7'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_8', 'Report 8', '8', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773700000, 1640773700000, 1640774700000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_8', b'0', '100001100001', 'env_8', 3, 1, 0, 2, 20, 18, 'Calculating', 'Calculating', '70%', '75%', '80%', 'script_8'); -INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_9', 'Report 9', '9', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773800000, 1640773800000, 1640774800000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_9', b'1', '100001100001', 'env_9', 0, 0, 14, 14, 18, 16, 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_9'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_1', 'Report 1', '1', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773000000, UNIX_TIMESTAMP() * 1000, 1640774000000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_1', b'0', '100001100001', 'env_1', 2, 0, 0, 2, 20, 18, '95%', 'Calculating', 'Calculating', '90%', '90%', 'script_1'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_10', 'Report 10', '3', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773900000, UNIX_TIMESTAMP() * 1000, 1640774900000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_10', b'0', '100001100001', 'env_10', 2, 0, 0, 2, 22, 20, '90%', 'Calculating', 'Calculating', '85%', '80%', 'script_10'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_11', 'Report 11', '4', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774000000, UNIX_TIMESTAMP() * 1000, 1640775000000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_11', b'0', '100001100001', 'env_11', 3, 1, 0, 2, 28, 26, '75%', 'Calculating', 'Calculating', '80%', '85%', 'script_11'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_12', 'Report 12', '5', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774100000, UNIX_TIMESTAMP() * 1000, 1640775100000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_12', b'1', '100001100001', 'env_12', 0, 0, 16, 16, 26, 24, 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_12'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_13', 'Report 13', '6', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774200000, UNIX_TIMESTAMP() * 1000, 1640775200000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_13', b'0', '100001100001', 'env_13', 2, 0, 0, 2, 24, 22, '80%', 'Calculating', 'Calculating', '85%', '90%', 'script_13'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_14', 'Report 14', '7', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774300000, UNIX_TIMESTAMP() * 1000, 1640775300000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_14', b'0', '100001100001', 'env_14', 3, 1, 0, 2, 20, 18, '70%', 'Calculating', 'Calculating', '75%', '80%', 'script_14'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_15', 'Report 15', '8', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774400000, UNIX_TIMESTAMP() * 1000, 1640775400000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_15', b'1', '100001100001', 'env_15', 0, 0, 18, 18, 22, 20, 'Calculating','Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_15'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_16', 'Report 16', '3', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774500000, UNIX_TIMESTAMP() * 1000, 1640775500000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_16', b'0', '100001100001', 'env_16', 2, 0, 0, 2, 20, 18, '85%', 'Calculating', 'Calculating', '90%', '90%', 'script_16'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_17', 'Report 17', '4', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774600000, UNIX_TIMESTAMP() * 1000, 1640775600000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_17', b'0', '100001100001', 'env_17', 3, 1, 0, 2, 26, 24, '75%', 'Calculating', 'Calculating', '80%', '85%', 'script_17'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_18', 'Report 18', '5', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774700000, UNIX_TIMESTAMP() * 1000, 1640775700000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_18', b'1', '100001100001', 'env_18', 0, 0, 20, 20, 30, 28, 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_18'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_19', 'Report 19', '6', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774800000, UNIX_TIMESTAMP() * 1000, 1640775800000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_19', b'0', '100001100001', 'env_19', 2, 0, 0, 2, 18, 16, '90%', 'Calculating', 'Calculating', '85%', '80%', 'script_19'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_2', 'Report 2', '2', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773100000, UNIX_TIMESTAMP() * 1000, 1640774100000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_2', b'0', '100001100001', 'env_2', 3, 1, 0, 2, 22, 20, '80%', 'Calculating', 'Calculating', '85%', '90%', 'script_2'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_20', 'Report 20', '2', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640774900000, UNIX_TIMESTAMP() * 1000, 1640775900000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_20', b'0', '100001100001', 'env_20', 3, 1, 0, 2, 22, 20, '70%', 'Calculating', 'Calculating', '75%', '80%', 'script_20'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_3', 'Report 3', '3', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773200000, UNIX_TIMESTAMP() * 1000, 1640774200000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_3', b'1', '100001100001', 'env_3', 0, 0, 10, 10, 30, 28, 'Calculating','Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_3'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_4', 'Report 4', '4', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773300000, UNIX_TIMESTAMP() * 1000, 1640774300000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_4', b'0', '100001100001', 'env_4', 2, 0, 0, 2, 18, 16, '90%','Calculating', 'Calculating', '85%', '80%', 'script_4'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_5', 'Report 5', '5', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773400000, UNIX_TIMESTAMP() * 1000, 1640774400000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_5', b'0', '100001100001', 'env_5', 3, 1, 0, 2, 24, 22, '70%', 'Calculating', 'Calculating', '75%', '80%', 'script_5'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_6', 'Report 6', '6', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773500000, UNIX_TIMESTAMP() * 1000, 1640774500000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_6', b'1', '100001100001', 'env_6', 0, 0, 12, 12, 20, 18, 'Calculating','Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_6'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_7', 'Report 7', '7', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773600000, UNIX_TIMESTAMP() * 1000, 1640774600000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', 'version_7', b'0', '100001100001', 'env_7', 2, 0, 0, 2, 16, 14, '85%', 'Calculating', 'Calculating', '90%', '90%', 'script_7'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_8', 'Report 8', '8', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773700000, UNIX_TIMESTAMP() * 1000, 1640774700000, 5000, 'ERROR', 'Automated', 'Distributed', '100660357777795313', 'version_8', b'0', '100001100001', 'env_8', 3, 1, 0, 2, 20, 18, 'Calculating', 'Calculating', '70%', '75%', '80%', 'script_8'); +INSERT INTO `api_scenario_report` (`id`, `name`, `scenario_id`, `test_plan_id`, `create_user`, `delete_time`, `delete_user`, `deleted`, `update_user`, `update_time`, `start_time`, `end_time`, `request_duration`, `status`, `trigger_mode`, `run_mode`, `pool_id`, `version_id`, `integrated`, `project_id`, `environment_id`, `error_count`, `fake_error_count`, `pending_count`, `success_count`, `assertion_count`, `assertion_success_count`, `request_error_rate`, `request_pending_rate`, `request_fake_error_rate`, `request_pass_rate`, `assertion_pass_rate`, `script_identifier`) VALUES ('report_9', 'Report 9', '9', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773800000, UNIX_TIMESTAMP() * 1000, 1640774800000, 5000, 'PENDING', 'Automated', 'Standalone', '100660357777795313', 'version_9', b'1', '100001100001', 'env_9', 0, 0, 14, 14, 18, 16, 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'Calculating', 'script_9'); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/request/TaskCenterBatchRequest.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/request/TaskCenterBatchRequest.java new file mode 100644 index 0000000000..cf3f7f996c --- /dev/null +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/taskcenter/request/TaskCenterBatchRequest.java @@ -0,0 +1,21 @@ +package io.metersphere.system.dto.taskcenter.request; + +import io.metersphere.sdk.constants.TaskCenterResourceType; +import io.metersphere.system.dto.table.TableBatchProcessDTO; +import io.metersphere.system.valid.EnumValue; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +@Data +public class TaskCenterBatchRequest extends TableBatchProcessDTO implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + + @Schema(description = "所属模块", requiredMode = Schema.RequiredMode.REQUIRED) + @EnumValue(enumClass = TaskCenterResourceType.class) + private String moduleType = TaskCenterResourceType.API_CASE.toString(); + +} diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/log/constants/OperationLogModule.java b/backend/services/system-setting/src/main/java/io/metersphere/system/log/constants/OperationLogModule.java index 2f7e700844..cddae56654 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/log/constants/OperationLogModule.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/log/constants/OperationLogModule.java @@ -120,4 +120,10 @@ public class OperationLogModule { public static final String PERSONAL_INFORMATION_LOCAL_EXECUTE = "PERSONAL_INFORMATION_LOCAL_EXECUTE"; // 个人信息-三方平台账号 public static final String PERSONAL_INFORMATION_TRIPARTITE = "PERSONAL_INFORMATION_TRIPARTITE"; + //系统任务中心:SETTING_SYSTEM_TASK_CENTER + public static final String SETTING_SYSTEM_TASK_CENTER = "SETTING_SYSTEM_TASK_CENTER"; + //组织任务中心:SETTING_ORGANIZATION_TASK_CENTER + public static final String SETTING_ORGANIZATION_TASK_CENTER = "SETTING_ORGANIZATION_TASK_CENTER"; + //项目任务中心:PROJECT_MANAGEMENT_TASK_CENTER + public static final String PROJECT_MANAGEMENT_TASK_CENTER = "PROJECT_MANAGEMENT_TASK_CENTER"; } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/utils/TaskRunnerClient.java b/backend/services/system-setting/src/main/java/io/metersphere/system/utils/TaskRunnerClient.java index dfeee1adad..67ee16ab3f 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/utils/TaskRunnerClient.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/utils/TaskRunnerClient.java @@ -14,6 +14,7 @@ import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; +import java.util.List; import java.util.concurrent.TimeUnit; @Component @@ -22,6 +23,7 @@ public class TaskRunnerClient { private static final String API_DEBUG = "/api/debug"; private static final String HTTP_BATH = "http://%s:%s"; + private static final String API_STOP = "/api/stop"; private static final RestTemplate restTemplateWithTimeOut = new RestTemplate(); private static final int retryCount = 3; @@ -37,11 +39,15 @@ public class TaskRunnerClient { post(endpoint + API_DEBUG, taskRequest); } + public static void stopApi(String endpoint, List reportIds) throws Exception { + post(endpoint + API_STOP, reportIds); + } + public static String getEndpoint(String ip, String port) { return String.format(HTTP_BATH, ip, port); } - public static ResultHolder get(String url, Object... uriVariables) throws Exception { + public static ResultHolder get(String url, Object... uriVariables) throws Exception { // 定义action Action action = (u, body) -> { String token = totpGenerator.now();