From 2cbeb7795691834218a9d6aa474a95c1ca9888e9 Mon Sep 17 00:00:00 2001 From: lan-yonghui Date: Mon, 29 Jan 2024 15:41:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=AE=A1=E7=90=86-=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9A=E4=B9=89-=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../definition/ApiDefinitionAddRequest.java | 4 +- .../ExtApiDefinitionCustomFieldMapper.java | 5 +- .../ExtApiDefinitionCustomFieldMapper.xml | 14 +++- .../api/mapper/ExtApiDefinitionMapper.xml | 2 +- .../definition/ApiDefinitionService.java | 70 ++++++++----------- .../ApiDefinitionControllerTests.java | 52 ++++++++------ .../resources/dml/init_api_definition.sql | 8 +-- 7 files changed, 85 insertions(+), 70 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionAddRequest.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionAddRequest.java index cb3816b16b..16a60af5f0 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionAddRequest.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionAddRequest.java @@ -1,5 +1,6 @@ package io.metersphere.api.dto.definition; +import io.metersphere.api.domain.ApiDefinitionCustomField; import io.metersphere.sdk.constants.ModuleConstants; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; @@ -13,7 +14,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; -import java.util.Map; /** * @author lan @@ -86,7 +86,7 @@ public class ApiDefinitionAddRequest implements Serializable { private List linkFileIds; @Schema(description = "自定义字段集合") - private Map customFields; + private List customFields; public void setPath(String path) { this.path = StringUtils.trim(path); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionCustomFieldMapper.java b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionCustomFieldMapper.java index c5c5fc8358..c51fd4ec5d 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionCustomFieldMapper.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionCustomFieldMapper.java @@ -1,5 +1,6 @@ package io.metersphere.api.mapper; +import io.metersphere.api.domain.ApiDefinitionCustomField; import io.metersphere.api.dto.definition.ApiDefinitionCustomFieldDTO; import org.apache.ibatis.annotations.Param; @@ -13,10 +14,12 @@ import java.util.List; public interface ExtApiDefinitionCustomFieldMapper { /** * 获取缺陷自定义字段值 - * @param apiIds 接口集合 + * @param apiIds 接口集合 * @param projectId 项目ID * @return 缺陷自定义字段值 */ List getApiCustomFields(@Param("ids") List apiIds, @Param("projectId") String projectId); + int batchInsertCustomField(@Param("apiId") String apiId, @Param("list") List list); + } diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionCustomFieldMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionCustomFieldMapper.xml index 59111cbb66..ce7575a880 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionCustomFieldMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionCustomFieldMapper.xml @@ -3,10 +3,20 @@ + + + insert into api_definition_custom_field + (api_id, field_id, `value`) + values + + (#{apiId,jdbcType=VARCHAR}, #{item.fieldId,jdbcType=VARCHAR}, #{item.value,jdbcType=VARCHAR} + ) + + \ No newline at end of file diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml index 24c63d6b0a..bc1a17d368 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMapper.xml @@ -57,7 +57,7 @@ CONCAT( FORMAT( SUM( IF ( t2.`status` = 'SUCCESS', 1, 0 ))/ COUNT( t1.id )* 100, 2 ), '%' ) casePassRate FROM api_test_case t1 - LEFT JOIN api_report t2 ON t1.last_report_id = t2.id + LEFT JOIN api_report t2 ON t1.id = t2.resource_id WHERE t1.project_id = #{projectId} and t1.deleted = 0 diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java index efddf8db52..7775c8981e 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java @@ -38,7 +38,6 @@ import io.metersphere.system.utils.CustomFieldUtils; import io.metersphere.system.utils.ServiceUtils; import jakarta.annotation.Resource; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; @@ -198,11 +197,10 @@ public class ApiDefinitionService { apiFileResourceService.addFileResource(resourceUpdateRequest); //保存自定义字段 - Map customFields = request.getCustomFields(); - if (MapUtils.isNotEmpty(customFields)) { - List list = new ArrayList<>(); - customFields.keySet().forEach(key -> createNewCustomField(apiDefinition.getId(), key, customFields.get(key), list)); - batchInsertCustomFields(list); + List customFields = request.getCustomFields(); + if (CollectionUtils.isNotEmpty(customFields)) { + customFields = customFields.stream().distinct().toList(); + batchInsertCustomFields(apiDefinition.getId(), customFields); } return apiDefinition; @@ -264,7 +262,7 @@ public class ApiDefinitionService { apiDefinitionBlobMapper.updateByPrimaryKeySelective(apiDefinitionBlob); // 自定义字段 - handleUpdateCustomFields(request, false); + handleUpdateCustomFields(request); // 处理文件 ApiFileResourceUpdateRequest resourceUpdateRequest = getApiFileResourceUpdateRequest(originApiDefinition.getId(), originApiDefinition.getProjectId(), userId); @@ -288,13 +286,17 @@ public class ApiDefinitionService { } else if (request.getType().equals("customs")) { // 自定义字段处理 ApiDefinitionCustomFieldDTO customField = request.getCustomField(); - Map customFieldMap = Collections.singletonMap(customField.getId(), customField.getValue()); + List list = new ArrayList<>(); + ApiDefinitionCustomField apiDefinitionCustomField = new ApiDefinitionCustomField(); + apiDefinitionCustomField.setFieldId(customField.getId()); + apiDefinitionCustomField.setValue(customField.getValue()); + list.add(apiDefinitionCustomField); ApiDefinitionUpdateRequest apiDefinitionUpdateRequest = new ApiDefinitionUpdateRequest(); BeanUtils.copyBean(apiDefinitionUpdateRequest, request); - apiDefinitionUpdateRequest.setCustomFields(customFieldMap); + apiDefinitionUpdateRequest.setCustomFields(list); ids.forEach(id -> { apiDefinitionUpdateRequest.setId(id); - handleUpdateCustomFields(apiDefinitionUpdateRequest, request.isAppend()); + handleUpdateCustomFields(apiDefinitionUpdateRequest); }); } else { ApiDefinition apiDefinition = new ApiDefinition(); @@ -309,61 +311,51 @@ public class ApiDefinitionService { } - private void handleUpdateCustomFields(ApiDefinitionUpdateRequest request, boolean append) { - Map customFields = request.getCustomFields(); - if (MapUtils.isNotEmpty(customFields)) { + private void handleUpdateCustomFields(ApiDefinitionUpdateRequest request) { + List customFields = request.getCustomFields(); + //更新自定义字段 + if (CollectionUtils.isNotEmpty(customFields)) { List addFields = new ArrayList<>(); List updateFields = new ArrayList<>(); List originalFields = extApiDefinitionCustomFieldMapper.getApiCustomFields(List.of(request.getId()), request.getProjectId()); - Map originalFieldMap = originalFields.stream().collect(Collectors.toMap(ApiDefinitionCustomFieldDTO::getId, ApiDefinitionCustomFieldDTO::getValue)); - customFields.keySet().forEach(fieldId -> { - if (!originalFieldMap.containsKey(fieldId)) { + Map originalFieldMap = originalFields.stream().collect(Collectors.toMap(ApiDefinitionCustomFieldDTO::getId, Function.identity())); + + customFields.forEach(customField -> { + if (!originalFieldMap.containsKey(customField.getFieldId())) { // New custom field relationship - createNewCustomField(request.getId(), fieldId, customFields.get(fieldId), addFields); + updateExistingCustomField(request.getId(), customField, addFields); } else { // Existing custom field relationship - updateExistingCustomField(request.getId(), fieldId, append, customFields.get(fieldId), updateFields, originalFieldMap); + updateExistingCustomField(request.getId(), customField, updateFields); } }); - batchInsertCustomFields(addFields); - batchUpdateCustomFields(updateFields); + batchInsertCustomFields(request.getId(), addFields); + batchUpdateCustomFields(request.getId(), updateFields); } } - private void createNewCustomField(String apiId, String fieldId, String value, List addFields) { + private void updateExistingCustomField(String apiId, ApiDefinitionCustomField customField, List updateFields) { ApiDefinitionCustomField apiDefinitionCustomField = new ApiDefinitionCustomField(); apiDefinitionCustomField.setApiId(apiId); - apiDefinitionCustomField.setFieldId(fieldId); - apiDefinitionCustomField.setValue(value); - addFields.add(apiDefinitionCustomField); - } - - private void updateExistingCustomField(String apiId, String fieldId, boolean append, String value, List updateFields, Map originalFieldMap) { - ApiDefinitionCustomField apiDefinitionCustomField = new ApiDefinitionCustomField(); - apiDefinitionCustomField.setApiId(apiId); - apiDefinitionCustomField.setFieldId(fieldId); - if (append) { - apiDefinitionCustomField.setValue(CustomFieldUtils.appendToMultipleCustomField(originalFieldMap.get(fieldId), value)); - } else { - apiDefinitionCustomField.setValue(value); - } + apiDefinitionCustomField.setFieldId(customField.getFieldId()); + apiDefinitionCustomField.setValue(customField.getValue()); updateFields.add(apiDefinitionCustomField); } - private void batchInsertCustomFields(List addFields) { + private void batchInsertCustomFields(String apiId, List addFields) { if (CollectionUtils.isNotEmpty(addFields)) { - apiDefinitionCustomFieldMapper.batchInsert(addFields); + extApiDefinitionCustomFieldMapper.batchInsertCustomField(apiId, addFields); } } - private void batchUpdateCustomFields(List updateFields) { + private void batchUpdateCustomFields(String apiId, List updateFields) { if (CollectionUtils.isNotEmpty(updateFields)) { SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); ApiDefinitionCustomFieldMapper apiCustomFieldMapper = sqlSession.getMapper(ApiDefinitionCustomFieldMapper.class); for (ApiDefinitionCustomField apiDefinitionCustomField : updateFields) { ApiDefinitionCustomFieldExample apiDefinitionCustomFieldExample = new ApiDefinitionCustomFieldExample(); - apiDefinitionCustomFieldExample.createCriteria().andApiIdEqualTo(apiDefinitionCustomField.getApiId()).andFieldIdEqualTo(apiDefinitionCustomField.getFieldId()); + apiDefinitionCustomFieldExample.createCriteria().andApiIdEqualTo(apiId).andFieldIdEqualTo(apiDefinitionCustomField.getFieldId()); apiCustomFieldMapper.updateByExample(apiDefinitionCustomField, apiDefinitionCustomFieldExample); } sqlSession.flushStatements(); diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java index a8bee2a10a..944efc22d7 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java @@ -136,12 +136,6 @@ public class ApiDefinitionControllerTests extends BaseTest { @Resource private ApiTestCaseBlobMapper apiTestCaseBlobMapper; - @Resource - private OperationLogMapper operationLogMapper; - - @Resource - private OperationLogBlobMapper operationLogBlobMapper; - @Resource private FileMetadataService fileMetadataService; private static String fileMetadataId; @@ -253,14 +247,24 @@ public class ApiDefinitionControllerTests extends BaseTest { request.setVersionId(defaultVersion); request.setDescription("描述内容"); request.setTags(new LinkedHashSet<>(List.of("tag1", "tag2"))); - Map customFieldMap = new HashMap<>(); - customFieldMap.put("custom-field", "oasis"); - customFieldMap.put("test_field", JSON.toJSONString(List.of("test"))); - - request.setCustomFields(customFieldMap); + List customFields= createCustomFields(); + request.setCustomFields(customFields); return request; } + private List createCustomFields() { + List list = new ArrayList<>(); + ApiDefinitionCustomField customField = new ApiDefinitionCustomField(); + customField.setFieldId("custom-field"); + customField.setValue("oasis"); + list.add(customField); + ApiDefinitionCustomField customField2 = new ApiDefinitionCustomField(); + customField2.setFieldId("test_field"); + customField2.setValue(JSON.toJSONString(List.of("test"))); + list.add(customField2); + return list; + } + private ApiDefinition assertAddApiDefinition(Object request, MsHTTPElement msHttpElement, String id) { ApiDefinition apiDefinition = apiDefinitionMapper.selectByPrimaryKey(id); ApiDefinitionBlob apiDefinitionBlob = apiDefinitionBlobMapper.selectByPrimaryKey(id); @@ -325,11 +329,7 @@ public class ApiDefinitionControllerTests extends BaseTest { request.setMethod("POST"); request.setModuleId("default1"); request.setTags(new LinkedHashSet<>(List.of("tag1", "tag2-update"))); - Map customFieldMap = new HashMap<>(); - customFieldMap.put("custom-field", "oasis-update"); - customFieldMap.put("test_field", JSON.toJSONString(List.of("test-update"))); - - request.setCustomFields(customFieldMap); + request.setCustomFields(updateCustomFields()); MsHTTPElement msHttpElement = MsHTTPElementTest.getMsHttpElement(); request.setRequest(getMsElementParam(msHttpElement)); List msHttpResponse = MsHTTPElementTest.getMsHttpResponse(); @@ -413,7 +413,7 @@ public class ApiDefinitionControllerTests extends BaseTest { addRequest.setVersionId(DEFAULT_PROJECT_ID); addRequest.setDescription("描述内容"); addRequest.setTags(new LinkedHashSet<>(List.of("tag1", "tag2"))); - addRequest.setCustomFields(new HashMap<>()); + addRequest.setCustomFields(new ArrayList<>()); addRequest.setRequest(getMsElementParam(msHttpElement)); addRequest.setResponse(msHttpResponse); MvcResult mvcResult = this.requestPostWithOkAndReturn(ADD, addRequest); @@ -465,6 +465,19 @@ public class ApiDefinitionControllerTests extends BaseTest { requestPostPermissionTest(PermissionConstants.PROJECT_API_DEFINITION_UPDATE, UPDATE, request); } + private List updateCustomFields() { + List list = new ArrayList<>(); + ApiDefinitionCustomField customField = new ApiDefinitionCustomField(); + customField.setFieldId("custom-field"); + customField.setValue("oasis-update"); + list.add(customField); + ApiDefinitionCustomField customField2 = new ApiDefinitionCustomField(); + customField2.setFieldId("test_field"); + customField2.setValue(JSON.toJSONString(List.of("test-update"))); + list.add(customField2); + return list; + } + /** * 文件管理插入一条数据 * 便于测试关联文件 @@ -545,16 +558,13 @@ public class ApiDefinitionControllerTests extends BaseTest { apiDefinitionBatchUpdateRequest.setAppend(false); this.requestPostWithOk(BATCH_UPDATE, apiDefinitionBatchUpdateRequest); assertBatchUpdateApiDefinition(apiDefinitionBatchUpdateRequest, List.of("1003", "1004")); - // 自定义字段追加 + // 自定义字段覆盖 apiDefinitionBatchUpdateRequest.setType("customs"); apiDefinitionBatchUpdateRequest.setSelectIds(List.of("1002", "1003", "1004")); ApiDefinitionCustomFieldDTO field = new ApiDefinitionCustomFieldDTO(); field.setId("test_field"); field.setValue(JSON.toJSONString(List.of("test1-batch"))); apiDefinitionBatchUpdateRequest.setCustomField(field); - apiDefinitionBatchUpdateRequest.setAppend(true); - this.requestPostWithOk(BATCH_UPDATE, apiDefinitionBatchUpdateRequest); - // 自定义字段覆盖 apiDefinitionBatchUpdateRequest.setAppend(false); this.requestPostWithOk(BATCH_UPDATE, apiDefinitionBatchUpdateRequest); // 修改协议类型 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 69a3b8cb20..3521e50527 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 @@ -69,15 +69,15 @@ 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, 'SUCCESS', '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 ('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, '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 ('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, 'ERROR', '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 ('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, 'SUCCESS', '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 ('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');