feat(接口管理): 接口管理-接口定义-自定义字段处理

This commit is contained in:
lan-yonghui 2024-01-29 15:41:07 +08:00 committed by Craftsman
parent db08d4215e
commit 2cbeb77956
7 changed files with 85 additions and 70 deletions

View File

@ -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<String> linkFileIds;
@Schema(description = "自定义字段集合")
private Map<String, String> customFields;
private List<ApiDefinitionCustomField> customFields;
public void setPath(String path) {
this.path = StringUtils.trim(path);

View File

@ -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;
@ -19,4 +20,6 @@ public interface ExtApiDefinitionCustomFieldMapper {
*/
List<ApiDefinitionCustomFieldDTO> getApiCustomFields(@Param("ids") List<String> apiIds, @Param("projectId") String projectId);
int batchInsertCustomField(@Param("apiId") String apiId, @Param("list") List<ApiDefinitionCustomField> list);
}

View File

@ -3,10 +3,20 @@
<mapper namespace="io.metersphere.api.mapper.ExtApiDefinitionCustomFieldMapper">
<select id="getApiCustomFields" resultType="io.metersphere.api.dto.definition.ApiDefinitionCustomFieldDTO">
select cf.*, adcf.value, adcf.api_id from api_definition_custom_field adcf join custom_field cf on adcf.field_id = cf.id
where cf.scene = 'API' and cf.scope_type = 'PROJECT' and scope_id = #{projectId}
and api_id in
where cf.scene = 'API' and cf.scope_type = 'PROJECT' and cf.scope_id = #{projectId}
and adcf.api_id in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</select>
<insert id="batchInsertCustomField" parameterType="map">
insert into api_definition_custom_field
(api_id, field_id, `value`)
values
<foreach collection="list" item="item" separator=",">
(#{apiId,jdbcType=VARCHAR}, #{item.fieldId,jdbcType=VARCHAR}, #{item.value,jdbcType=VARCHAR}
)
</foreach>
</insert>
</mapper>

View File

@ -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

View File

@ -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<String, String> customFields = request.getCustomFields();
if (MapUtils.isNotEmpty(customFields)) {
List<ApiDefinitionCustomField> list = new ArrayList<>();
customFields.keySet().forEach(key -> createNewCustomField(apiDefinition.getId(), key, customFields.get(key), list));
batchInsertCustomFields(list);
List<ApiDefinitionCustomField> 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<String, String> customFieldMap = Collections.singletonMap(customField.getId(), customField.getValue());
List<ApiDefinitionCustomField> 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<String, String> customFields = request.getCustomFields();
if (MapUtils.isNotEmpty(customFields)) {
private void handleUpdateCustomFields(ApiDefinitionUpdateRequest request) {
List<ApiDefinitionCustomField> customFields = request.getCustomFields();
//更新自定义字段
if (CollectionUtils.isNotEmpty(customFields)) {
List<ApiDefinitionCustomField> addFields = new ArrayList<>();
List<ApiDefinitionCustomField> updateFields = new ArrayList<>();
List<ApiDefinitionCustomFieldDTO> originalFields = extApiDefinitionCustomFieldMapper.getApiCustomFields(List.of(request.getId()), request.getProjectId());
Map<String, String> originalFieldMap = originalFields.stream().collect(Collectors.toMap(ApiDefinitionCustomFieldDTO::getId, ApiDefinitionCustomFieldDTO::getValue));
customFields.keySet().forEach(fieldId -> {
if (!originalFieldMap.containsKey(fieldId)) {
Map<String, ApiDefinitionCustomFieldDTO> 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<ApiDefinitionCustomField> addFields) {
private void updateExistingCustomField(String apiId, ApiDefinitionCustomField customField, List<ApiDefinitionCustomField> 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<ApiDefinitionCustomField> updateFields, Map<String, String> 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<ApiDefinitionCustomField> addFields) {
private void batchInsertCustomFields(String apiId, List<ApiDefinitionCustomField> addFields) {
if (CollectionUtils.isNotEmpty(addFields)) {
apiDefinitionCustomFieldMapper.batchInsert(addFields);
extApiDefinitionCustomFieldMapper.batchInsertCustomField(apiId, addFields);
}
}
private void batchUpdateCustomFields(List<ApiDefinitionCustomField> updateFields) {
private void batchUpdateCustomFields(String apiId, List<ApiDefinitionCustomField> 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();

View File

@ -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<String, String> customFieldMap = new HashMap<>();
customFieldMap.put("custom-field", "oasis");
customFieldMap.put("test_field", JSON.toJSONString(List.of("test")));
request.setCustomFields(customFieldMap);
List<ApiDefinitionCustomField> customFields= createCustomFields();
request.setCustomFields(customFields);
return request;
}
private List<ApiDefinitionCustomField> createCustomFields() {
List<ApiDefinitionCustomField> 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<String, String> 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<HttpResponse> 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<ApiDefinitionCustomField> updateCustomFields() {
List<ApiDefinitionCustomField> 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);
// 修改协议类型

View File

@ -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');