refactor(接口测试): 优化报告状态

This commit is contained in:
wxg0103 2024-03-25 14:29:55 +08:00 committed by Craftsman
parent 96d4780afa
commit a9396da1b6
11 changed files with 29 additions and 25 deletions

View File

@ -174,7 +174,7 @@ public class ApiDefinitionModuleControllerTests extends BaseTest {
apiTestCase.setUpdateUser("admin");
apiTestCase.setVersionId("1.0");
apiTestCase.setDeleted(false);
caseMapper.insert(apiTestCase);
caseMapper.insertSelective(apiTestCase);
ApiTestCaseBlob apiTestCaseBlob = new ApiTestCaseBlob();
apiTestCaseBlob.setId(apiTestCase.getId());
apiTestCaseBlob.setRequest(JSON.toJSONBytes(msHttpElement));

View File

@ -72,7 +72,7 @@ public class ApiReportSendNoticeTests extends BaseTest {
apiTestCase.setUpdateUser("admin");
apiTestCase.setVersionId("1.0");
apiTestCase.setDeleted(false);
apiTestCaseMapper.insert(apiTestCase);
apiTestCaseMapper.insertSelective(apiTestCase);
List<ApiReport> reports = new ArrayList<>();
List<ApiTestCaseRecord> records = new ArrayList<>();

View File

@ -806,7 +806,7 @@ public class ApiScenarioControllerTests extends BaseTest {
@Order(7)
public void testLoopController() throws Exception {
// @@请求成功
mockPost("/api/debug", "");
mockPost("/api/scenario/debug", "");
baseResourcePoolTestService.initProjectResourcePool();
// @@请求成功
@ -2580,6 +2580,7 @@ public class ApiScenarioControllerTests extends BaseTest {
apiTestCase.setPos(i * 64L);
apiTestCase.setApiDefinitionId("system-api-id");
apiTestCase.setVersionId("1.0");
apiTestCase.setLastReportStatus("未执行");
apiTestCases.add(apiTestCase);
}
apiTestCaseMapper.batchInsert(apiTestCases);

View File

@ -221,6 +221,7 @@ public class ApiTestCaseControllerTests extends BaseTest {
apiTestCase.setUpdateUser("admin");
apiTestCase.setVersionId("1.0");
apiTestCase.setDeleted(false);
apiTestCase.setLastReportStatus("SUCCESS");
caseMapper.insert(apiTestCase);
ApiTestCaseBlob apiTestCaseBlob = new ApiTestCaseBlob();
apiTestCaseBlob.setId(apiTestCase.getId());

View File

@ -12,15 +12,15 @@ DELETE FROM `project_version` WHERE `id` = '100570499574136985';
INSERT INTO project_version (id, project_id, name, description, status, latest, publish_time, start_time, end_time, create_time, create_user) VALUES ('100570499574136985', '100001100001', 'v1.0.0', NULL, 'open', 1, UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin');
DELETE FROM `api_test_case` WHERE `id` in ('12df5721-c5e6-a38b-e999-3eafcb992094','12df5721-c5e6-a38b-e999-3eafcb992100','12df5721-c5e6-a38b-e999-3eafcb992233','3ee2ae9c-a680-4ed6-b115-1f6ab8980973','3ee2ae9c-a680-4ed6-b115-1f6ab8980100','3ee2ae9c-a680-4ed6-b115-1f6ab8980589','3ee2ae9c-a680-4ed6-b115-1f6ab8980553','3ee2ae9c-a680-4ed6-b115-1f6ab8980104','3ee2ae9c-a680-4ed6-b115-1f6ab8980545');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('12df5721-c5e6-a38b-e999-3eafcb992094', '查询windows主机1', 'P0', 100002001, NULL, 'PROCESSING', NULL, '10001', 10000, '100001100001', '1001', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('12df5721-c5e6-a38b-e999-3eafcb992100', '查询windows主机2', 'P0', 100002002, NULL, 'PROCESSING', NULL, '10002', 10000, '100001100001', '1001', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('12df5721-c5e6-a38b-e999-3eafcb992233', '查询windows主机3', 'P0', 100002003, NULL, 'PROCESSING', NULL, '10003', 10000, '100001100001', '1002', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980973', '查询Linux主机1', 'P0', 100002004, NULL, 'PROCESSING', NULL, '10004', 10000, '100001100001', '1002', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980100', '查询Linux主机2', 'P0', 100002005, NULL, 'PROCESSING', NULL, '10005', 10000, '100001100001', '1003', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980589', '查询Linux主机3', 'P0', 100002006, NULL, 'PROCESSING', NULL, '10006', 10000, '100001100001', '1004', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980553', '查询Linux主机4', 'P0', 100002007, NULL, 'PROCESSING', NULL, '10007', 10000, '100001100001', '1005', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980104', '查询Linux主机5', 'P0', 100002008, NULL, 'PROCESSING', NULL, '10008', 10000, '100001100001', '1005', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980545', '查询Linux主机6', 'P0', 100002009, NULL, 'PROCESSING', NULL, NULL, 10000, '100001100001', '1005', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('12df5721-c5e6-a38b-e999-3eafcb992094', '查询windows主机1', 'P0', 100002001, NULL, 'PROCESSING', 'PENDING', '10001', 10000, '100001100001', '1001', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('12df5721-c5e6-a38b-e999-3eafcb992100', '查询windows主机2', 'P0', 100002002, NULL, 'PROCESSING', 'PENDING', '10002', 10000, '100001100001', '1001', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('12df5721-c5e6-a38b-e999-3eafcb992233', '查询windows主机3', 'P0', 100002003, NULL, 'PROCESSING', 'PENDING', '10003', 10000, '100001100001', '1002', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980973', '查询Linux主机1', 'P0', 100002004, NULL, 'PROCESSING', 'PENDING', '10004', 10000, '100001100001', '1002', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980100', '查询Linux主机2', 'P0', 100002005, NULL, 'PROCESSING', 'PENDING', '10005', 10000, '100001100001', '1003', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980589', '查询Linux主机3', 'P0', 100002006, NULL, 'PROCESSING', 'PENDING', '10006', 10000, '100001100001', '1004', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980553', '查询Linux主机4', 'P0', 100002007, NULL, 'PROCESSING', 'PENDING', '10007', 10000, '100001100001', '1005', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980104', '查询Linux主机5', 'P0', 100002008, NULL, 'PROCESSING', 'PENDING', '10008', 10000, '100001100001', '1005', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
INSERT INTO `api_test_case` (`id`, `name`, `priority`, `num`, `tags`, `status`, `last_report_status`, `last_report_id`, `pos`, `project_id`, `api_definition_id`, `version_id`, `environment_id`, `create_time`, `create_user`, `update_time`, `update_user`, `delete_time`, `delete_user`, `deleted`) VALUES ('3ee2ae9c-a680-4ed6-b115-1f6ab8980545', '查询Linux主机6', 'P0', 100002009, NULL, 'PROCESSING', 'PENDING', NULL, 10000, '100001100001', '1005', '100570499574136985', 'admin', 1699500298164, 'admin', 1699500298164, 'admin', NULL, NULL, b'0');
DELETE FROM `api_definition_module` WHERE `id` in ('10001', 'case-moduleId');
INSERT INTO `api_definition_module` (`id`, `name`, `parent_id`, `project_id`, `pos`, `create_time`, `update_time`, `update_user`, `create_user`) VALUES ('10001', 'module1', 'NONE', '100001100001', 10, 0, 0, 'admin', 'admin');
@ -116,13 +116,13 @@ INSERT INTO `test_resource_pool` (`id`, `name`, `type`, `description`, `enable`,
DELETE FROM `api_scenario` WHERE `id` in ('1', '2', '3', '4','5','6', '7', '8', '9');
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 ('1', 'Scenario 1', 'P0', 'Completed', 10, '95%', 'Passed', 'report_1', 1001, b'0', 1, 'version_1', 'ref_1', b'1', '100001100001', 'module_1', 'Description 1', '[\"tag1\",\"tag2\"]', b'0', 'env_1', 'admin', 1640772861000, NULL, NULL, 'admin', 1640772861000);
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 ('2', 'Scenario 2', 'P1', 'In Progress', 15, '80%', 'Running', 'report_2', 1002, b'0', 2, 'version_2', 'ref_2', b'0', '100001100001', 'module_2', 'Description 2', '[\"tag2\",\"tag3\"]', b'0', NULL, 'admin', 1640772862000, NULL, NULL, 'admin', 1640772862000);
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 ('3', 'Scenario 3', 'P2', 'Not Planned', 8, 'Calculating', NULL, NULL, 1003, b'0', 3, 'version_3', 'ref_3', b'1', '100001100001', 'module_3', 'Description 3', '[\"tag1\",\"tag3\"]', b'1', 'env_2', 'admin', 1640772863000, NULL, NULL, 'admin', 1640772863000);
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 ('3', 'Scenario 3', 'P2', 'Not Planned', 8, 'Calculating', 'PENDING', NULL, 1003, b'0', 3, 'version_3', 'ref_3', b'1', '100001100001', 'module_3', 'Description 3', '[\"tag1\",\"tag3\"]', b'1', 'env_2', 'admin', 1640772863000, NULL, NULL, 'admin', 1640772863000);
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 ('4', 'Scenario 4', 'P1', 'Completed', 12, '90%', 'Passed', 'report_4', 1004, b'0', 4, 'version_4', 'ref_4', b'0', '100001100001', 'module_4', 'Description 4', '[\"tag1\",\"tag2\"]', b'0', NULL, 'admin', 1640772864000, NULL, NULL, 'admin', 1640772864000);
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 ('5', 'Scenario 5', 'P0', 'In Progress', 18, '75%', 'Running', 'report_5', 1005, b'0', 5, 'version_5', 'ref_5', b'1', '100001100001', 'module_5', 'Description 5', '[\"tag2\",\"tag3\"]', b'1', 'env_3', 'admin', 1640772865000, NULL, NULL, 'admin', 1640772865000);
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 ('6', 'Scenario 6', 'P2', 'Not Planned', 10, 'Calculating', NULL, NULL, 1006, b'0', 6, 'version_6', 'ref_6', b'0', '100001100001', 'module_6', 'Description 6', '[\"tag1\",\"tag3\"]', b'0', NULL, 'admin', 1640772866000, NULL, NULL, 'admin', 1640772866000);
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 ('6', 'Scenario 6', 'P2', 'Not Planned', 10, 'Calculating', 'PENDING', NULL, 1006, b'0', 6, 'version_6', 'ref_6', b'0', '100001100001', 'module_6', 'Description 6', '[\"tag1\",\"tag3\"]', b'0', NULL, 'admin', 1640772866000, NULL, NULL, 'admin', 1640772866000);
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 ('7', 'Scenario 7', 'P1', 'Completed', 14, '85%', 'Passed', 'report_7', 1007, b'0', 7, 'version_7', 'ref_7', b'1', '100001100001', 'module_7', 'Description 7', '[\"tag1\",\"tag2\"]', b'1', 'env_4', 'admin', 1640772867000, NULL, NULL, 'admin', 1640772867000);
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 ('8', 'Scenario 8', 'P0', 'In Progress', 20, '70%', 'Running', 'report_8', 1008, b'0', 8, 'version_8', 'ref_8', b'0', '100001100001', 'module_8', 'Description 8', '[\"tag2\",\"tag3\"]', b'0', NULL, 'admin', 1640772868000, NULL, NULL, 'admin', 1640772868000);
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);
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', 'PENDING', 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`, `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`, `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', 'NONE', 'admin', NULL, NULL, b'0', 'admin', 1640773000000, UNIX_TIMESTAMP() * 1000, 1640774000000, 5000, 'SUCCESS', 'Manual', 'Standalone', '100660357777795313', b'0', '100001100001', 'env_1', 2, 0, 0, 2, 20, 18, '95%', 'Calculating', 'Calculating', '90%', '90%', 'script_1');

View File

@ -14,12 +14,12 @@ VALUES ('gyq_associate_case_id_1', 100, 'TEST_MODULE_ID', 'project-associate-cas
INSERT INTO functional_case_blob(id, steps, text_description, expected_result, prerequisite, description) VALUES ('gyq_associate_case_id_1', 'STEP', '1111', '', '', 'TEST');
INSERT INTO api_test_case(id, name, priority, num, tags, status, last_report_status, last_report_id, pos, project_id, api_definition_id, version_id, environment_id, create_time, create_user, update_time, update_user, delete_time, delete_user, deleted)
VALUES ('gyq_associate_api_case_id_1','gyq_associate_api_case_id_1','P0',1001, null, 'Underway', null, null, 100, 'project-associate-case-test', 'gyq_associate_api_definition_id_1', 'gyq_associate_version_id', 'gyq_associate_env_id', 1698058347559, 'admin',1698058347559,'admin',null,null,false);
VALUES ('gyq_associate_api_case_id_1','gyq_associate_api_case_id_1','P0',1001, null, 'Underway', 'PENDING', null, 100, 'project-associate-case-test', 'gyq_associate_api_definition_id_1', 'gyq_associate_version_id', 'gyq_associate_env_id', 1698058347559, 'admin',1698058347559,'admin',null,null,false);
INSERT INTO api_test_case(id, name, priority, num, tags, status, last_report_status, last_report_id, pos, project_id, api_definition_id, version_id, environment_id, create_time, create_user, update_time, update_user, delete_time, delete_user, deleted)
VALUES ('gyq_associate_api_case_id_2','测试查询模块用','P0',1002, null, 'Underway', null, null, 200, 'project-associate-case-test', 'gyq_associate_api_definition_id_1', 'gyq_associate_version_id', 'gyq_associate_env_id', 1698058347559, 'admin',1698058347559,'admin',null,null,false);
VALUES ('gyq_associate_api_case_id_2','测试查询模块用','P0',1002, null, 'Underway', 'PENDING', null, 200, 'project-associate-case-test', 'gyq_associate_api_definition_id_1', 'gyq_associate_version_id', 'gyq_associate_env_id', 1698058347559, 'admin',1698058347559,'admin',null,null,false);
INSERT INTO api_definition(id, name, protocol, method, path, status, num, tags, pos, project_id, module_id, latest, version_id, ref_id, description, create_time, create_user, update_time, update_user, delete_user, delete_time, deleted)

View File

@ -14,8 +14,8 @@ VALUES ('gyq_associate_scenario_id_1', 100, 'TEST_MODULE_ID', 'project-associate
INSERT INTO functional_case_blob(id, steps, text_description, expected_result, prerequisite, description) VALUES ('gyq_associate_scenario_id_1', 'STEP', '1111', '', '', 'TEST');
INSERT INTO api_scenario(id, name, priority, status, last_report_status, last_report_id, num, pos, version_id, ref_id, project_id, module_id, description, tags, create_user, create_time, delete_time, delete_user, update_user, update_time, deleted)
VALUES ('associate_gyq_api_scenario_one', 'api_scenario', 'p1', 'test-api-status', null, null,1000001, 1,'v1.10', 'associate_gyq_api_scenario_one','project-associate-scenario-test', 'gyq_associate_test_scenario_module', null,null,'admin', UNIX_TIMESTAMP() * 1000,null,null,'admin', UNIX_TIMESTAMP() * 1000, false),
('associate_gyq_api_scenario_two', 'api_scenario_two', 'p1', 'test-api-status', null, null,1000001, 1,'v1.10', 'associate_gyq_api_scenario_two','project-associate-scenario-test', 'gyq_associate_test_scenario_module', null,null,'admin', UNIX_TIMESTAMP() * 1000,null,null,'admin', UNIX_TIMESTAMP() * 1000, false);
VALUES ('associate_gyq_api_scenario_one', 'api_scenario', 'p1', 'test-api-status', 'PENDING', null,1000001, 1,'v1.10', 'associate_gyq_api_scenario_one','project-associate-scenario-test', 'gyq_associate_test_scenario_module', null,null,'admin', UNIX_TIMESTAMP() * 1000,null,null,'admin', UNIX_TIMESTAMP() * 1000, false),
('associate_gyq_api_scenario_two', 'api_scenario_two', 'p1', 'test-api-status', 'PENDING', null,1000001, 1,'v1.10', 'associate_gyq_api_scenario_two','project-associate-scenario-test', 'gyq_associate_test_scenario_module', null,null,'admin', UNIX_TIMESTAMP() * 1000,null,null,'admin', UNIX_TIMESTAMP() * 1000, false);
INSERT INTO api_scenario_module(id, name,parent_id, project_id, pos, create_time, update_time, update_user, create_user)

View File

@ -1174,7 +1174,7 @@ public class SystemProjectControllerTests extends BaseTest {
apiTestCase.setUpdateUser("admin");
apiTestCase.setVersionId("1.0");
apiTestCase.setDeleted(false);
apiTestCaseMapper.insert(apiTestCase);
apiTestCaseMapper.insertSelective(apiTestCase);
ApiTestCase anotherCase = new ApiTestCase();
anotherCase.setId("test-apiTestCaseId1");
anotherCase.setApiDefinitionId("apiDefinitionId");
@ -1190,7 +1190,7 @@ public class SystemProjectControllerTests extends BaseTest {
anotherCase.setUpdateUser("admin");
anotherCase.setVersionId("1.0");
anotherCase.setDeleted(false);
apiTestCaseMapper.insert(anotherCase);
apiTestCaseMapper.insertSelective(anotherCase);
PosRequest request = new PosRequest();
request.setProjectId(DEFAULT_PROJECT_ID);
request.setTargetId(apiTestCase.getId());

View File

@ -38,7 +38,7 @@ INSERT INTO api_definition(id, name, protocol, method, path, status, num, tags,
VALUES ('aspect_gyq_api_one', 'api_test','HTTP', 'POST','api/test','test-api-status', 1000001, null, 1, '100001100001' , 'test_module', true, 'v1.10','aspect_gyq_api_one', null, UNIX_TIMESTAMP() * 1000,'admin', UNIX_TIMESTAMP() * 1000,'admin', null,null,false);
INSERT INTO api_scenario(id, name, priority, status, last_report_status, last_report_id, num, pos, version_id, ref_id, project_id, module_id, description, tags, create_user, create_time, delete_time, delete_user, update_user, update_time)
VALUES ('aspect_gyq_api_scenario_one', 'api_scenario', 'p1', 'test-api-status', null, null,1000001, 1,'v1.10', 'aspect_gyq_api_scenario_one','100001100001', 'test_module', null,null,'admin', UNIX_TIMESTAMP() * 1000,null,null,'admin', UNIX_TIMESTAMP() * 1000);
VALUES ('aspect_gyq_api_scenario_one', 'api_scenario', 'p1', 'test-api-status', 'PENDING', null,1000001, 1,'v1.10', 'aspect_gyq_api_scenario_one','100001100001', 'test_module', null,null,'admin', UNIX_TIMESTAMP() * 1000,null,null,'admin', UNIX_TIMESTAMP() * 1000);
INSERT INTO test_plan(id, project_id, group_id, module_id, name, status, type, tags, create_time, create_user,
update_time, update_user, planned_start_time, planned_end_time, actual_start_time,

View File

@ -2,13 +2,13 @@
DELETE FROM `api_scenario` WHERE `id` in ('1', '2', '3', '4','5','6', '7', '8', '9');
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 ('1', 'Scenario 1', 'P0', 'Completed', 10, '95%', 'Passed', 'report_1', 1001, b'0', 1, 'version_1', 'ref_1', b'1', '100001100001', 'module_1', 'Description 1', 'Tag1,Tag2', b'0', 'env_1', 'admin', 1640772861000, NULL, NULL, 'admin', 1640772861000);
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 ('2', 'Scenario 2', 'P1', 'In Progress', 15, '80%', 'Running', 'report_2', 1002, b'0', 2, 'version_2', 'ref_2', b'0', '100001100001', 'module_2', 'Description 2', 'Tag2,Tag3', b'0', NULL, 'admin', 1640772862000, NULL, NULL, 'admin', 1640772862000);
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 ('3', 'Scenario 3', 'P2', 'Not Planned', 8, 'Calculating', NULL, NULL, 1003, b'0', 3, 'version_3', 'ref_3', b'1', '100001100001', 'module_3', 'Description 3', 'Tag1,Tag3', b'1', 'env_2', 'admin', 1640772863000, NULL, NULL, 'admin', 1640772863000);
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 ('3', 'Scenario 3', 'P2', 'Not Planned', 8, 'Calculating', 'PENDING', NULL, 1003, b'0', 3, 'version_3', 'ref_3', b'1', '100001100001', 'module_3', 'Description 3', 'Tag1,Tag3', b'1', 'env_2', 'admin', 1640772863000, NULL, NULL, 'admin', 1640772863000);
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 ('4', 'Scenario 4', 'P1', 'Completed', 12, '90%', 'Passed', 'report_4', 1004, b'0', 4, 'version_4', 'ref_4', b'0', '100001100001', 'module_4', 'Description 4', 'Tag1,Tag2', b'0', NULL, 'admin', 1640772864000, NULL, NULL, 'admin', 1640772864000);
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 ('5', 'Scenario 5', 'P0', 'In Progress', 18, '75%', 'Running', 'report_5', 1005, b'0', 5, 'version_5', 'ref_5', b'1', '100001100001', 'module_5', 'Description 5', 'Tag2,Tag3', b'1', 'env_3', 'admin', 1640772865000, NULL, NULL, 'admin', 1640772865000);
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 ('6', 'Scenario 6', 'P2', 'Not Planned', 10, 'Calculating', NULL, NULL, 1006, b'0', 6, 'version_6', 'ref_6', b'0', '100001100001', 'module_6', 'Description 6', 'Tag1,Tag3', b'0', NULL, 'admin', 1640772866000, NULL, NULL, 'admin', 1640772866000);
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 ('6', 'Scenario 6', 'P2', 'Not Planned', 10, 'Calculating', 'PENDING', NULL, 1006, b'0', 6, 'version_6', 'ref_6', b'0', '100001100001', 'module_6', 'Description 6', 'Tag1,Tag3', b'0', NULL, 'admin', 1640772866000, NULL, NULL, 'admin', 1640772866000);
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 ('7', 'Scenario 7', 'P1', 'Completed', 14, '85%', 'Passed', 'report_7', 1007, b'0', 7, 'version_7', 'ref_7', b'1', '100001100001', 'module_7', 'Description 7', 'Tag1,Tag2', b'1', 'env_4', 'admin', 1640772867000, NULL, NULL, 'admin', 1640772867000);
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 ('8', 'Scenario 8', 'P0', 'In Progress', 20, '70%', 'Running', 'report_8', 1008, b'0', 8, 'version_8', 'ref_8', b'0', '100001100001', 'module_8', 'Description 8', 'Tag2,Tag3', b'0', NULL, 'admin', 1640772868000, NULL, NULL, 'admin', 1640772868000);
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);
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', 'PENDING', 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 `schedule` WHERE `id` in ('1', '2', '3', '4','5','6', '7', '8', '9','10','11', '12', '13', '14','15','16', '17', '18', '19','20');

View File

@ -176,6 +176,7 @@ public class TestPlanTestService {
apiScenario.setDeleted(false);
apiScenario.setStepTotal(1);
apiScenario.setRequestPassRate("100");
apiScenario.setLastReportStatus("UN_EXECUTED");
returnList.add(apiScenario);
}
apiScenarioMapper.batchInsert(returnList);
@ -335,6 +336,7 @@ public class TestPlanTestService {
apiTestCase.setCreateUser("admin");
apiTestCase.setUpdateUser("admin");
apiTestCase.setUpdateTime(System.currentTimeMillis());
apiTestCase.setLastReportStatus("UN_EXECUTED");
returnList.add(apiTestCase);
}
apiTestCaseMapper.batchInsert(returnList);