diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanFunctionalCase.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanFunctionalCase.java index 41de80dd79..43e0702ac4 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanFunctionalCase.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanFunctionalCase.java @@ -40,10 +40,15 @@ public class TestPlanFunctionalCase implements Serializable { @Schema(description = "最后执行结果") private String lastExecResult; - @Schema(description = "自定义排序,间隔5000", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "自定义排序,间隔为2的n次幂", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "{test_plan_functional_case.pos.not_blank}", groups = {Created.class}) private Long pos; + @Schema(description = "测试计划集id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{test_plan_functional_case.test_plan_collection_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{test_plan_functional_case.test_plan_collection_id.length_range}", groups = {Created.class, Updated.class}) + private String testPlanCollectionId; + private static final long serialVersionUID = 1L; public enum Column { @@ -55,7 +60,8 @@ public class TestPlanFunctionalCase implements Serializable { executeUser("execute_user", "executeUser", "VARCHAR", false), lastExecTime("last_exec_time", "lastExecTime", "BIGINT", false), lastExecResult("last_exec_result", "lastExecResult", "VARCHAR", false), - pos("pos", "pos", "BIGINT", false); + pos("pos", "pos", "BIGINT", false), + testPlanCollectionId("test_plan_collection_id", "testPlanCollectionId", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanFunctionalCaseExample.java b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanFunctionalCaseExample.java index c163e177ed..aeef8302d5 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanFunctionalCaseExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/domain/TestPlanFunctionalCaseExample.java @@ -703,6 +703,76 @@ public class TestPlanFunctionalCaseExample { addCriterion("pos not between", value1, value2, "pos"); return (Criteria) this; } + + public Criteria andTestPlanCollectionIdIsNull() { + addCriterion("test_plan_collection_id is null"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdIsNotNull() { + addCriterion("test_plan_collection_id is not null"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdEqualTo(String value) { + addCriterion("test_plan_collection_id =", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotEqualTo(String value) { + addCriterion("test_plan_collection_id <>", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdGreaterThan(String value) { + addCriterion("test_plan_collection_id >", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdGreaterThanOrEqualTo(String value) { + addCriterion("test_plan_collection_id >=", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLessThan(String value) { + addCriterion("test_plan_collection_id <", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLessThanOrEqualTo(String value) { + addCriterion("test_plan_collection_id <=", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdLike(String value) { + addCriterion("test_plan_collection_id like", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotLike(String value) { + addCriterion("test_plan_collection_id not like", value, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdIn(List values) { + addCriterion("test_plan_collection_id in", values, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotIn(List values) { + addCriterion("test_plan_collection_id not in", values, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdBetween(String value1, String value2) { + addCriterion("test_plan_collection_id between", value1, value2, "testPlanCollectionId"); + return (Criteria) this; + } + + public Criteria andTestPlanCollectionIdNotBetween(String value1, String value2) { + addCriterion("test_plan_collection_id not between", value1, value2, "testPlanCollectionId"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanFunctionalCaseMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanFunctionalCaseMapper.xml index c6faecfa4f..73d9473f27 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanFunctionalCaseMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/plan/mapper/TestPlanFunctionalCaseMapper.xml @@ -11,6 +11,7 @@ + @@ -72,7 +73,7 @@ id, test_plan_id, functional_case_id, create_time, create_user, execute_user, last_exec_time, - last_exec_result, pos + last_exec_result, pos, test_plan_collection_id @@ -211,6 +218,9 @@ pos = #{record.pos,jdbcType=BIGINT}, + + test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR}, + @@ -226,7 +236,8 @@ execute_user = #{record.executeUser,jdbcType=VARCHAR}, last_exec_time = #{record.lastExecTime,jdbcType=BIGINT}, last_exec_result = #{record.lastExecResult,jdbcType=VARCHAR}, - pos = #{record.pos,jdbcType=BIGINT} + pos = #{record.pos,jdbcType=BIGINT}, + test_plan_collection_id = #{record.testPlanCollectionId,jdbcType=VARCHAR} @@ -258,6 +269,9 @@ pos = #{pos,jdbcType=BIGINT}, + + test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} @@ -270,19 +284,20 @@ execute_user = #{executeUser,jdbcType=VARCHAR}, last_exec_time = #{lastExecTime,jdbcType=BIGINT}, last_exec_result = #{lastExecResult,jdbcType=VARCHAR}, - pos = #{pos,jdbcType=BIGINT} + pos = #{pos,jdbcType=BIGINT}, + test_plan_collection_id = #{testPlanCollectionId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} insert into test_plan_functional_case (id, test_plan_id, functional_case_id, create_time, create_user, execute_user, last_exec_time, - last_exec_result, pos) + last_exec_result, pos, test_plan_collection_id) values (#{item.id,jdbcType=VARCHAR}, #{item.testPlanId,jdbcType=VARCHAR}, #{item.functionalCaseId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}, #{item.executeUser,jdbcType=VARCHAR}, #{item.lastExecTime,jdbcType=BIGINT}, #{item.lastExecResult,jdbcType=VARCHAR}, - #{item.pos,jdbcType=BIGINT}) + #{item.pos,jdbcType=BIGINT}, #{item.testPlanCollectionId,jdbcType=VARCHAR}) @@ -322,6 +337,9 @@ #{item.pos,jdbcType=BIGINT} + + #{item.testPlanCollectionId,jdbcType=VARCHAR} + ) diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_13__ga_ddl.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_13__ga_ddl.sql index 7d4d6ac5b3..96e33b7394 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_13__ga_ddl.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_13__ga_ddl.sql @@ -59,20 +59,24 @@ ALTER TABLE test_plan_report_bug MODIFY `bug_case_count` BIGINT NOT NULL DEFAUL -- 修改测试计划关联接口表字段 ALTER TABLE test_plan_api_case DROP COLUMN num; -ALTER TABLE test_plan_api_case ADD COLUMN test_plan_collection_id VARCHAR(50) NOT NULL COMMENT '测试计划集id'; +ALTER TABLE test_plan_api_case ADD COLUMN test_plan_collection_id VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '测试计划集id'; ALTER TABLE test_plan_api_case ADD COLUMN last_exec_time BIGINT COMMENT '最后执行时间'; CREATE INDEX idx_test_plan_collection_id ON test_plan_api_case(test_plan_collection_id); CREATE INDEX idx_pos ON test_plan_api_case(pos); -- 修改测试计划关联场景表字段 ALTER TABLE test_plan_api_scenario DROP COLUMN num; -ALTER TABLE test_plan_api_scenario ADD COLUMN test_plan_collection_id VARCHAR(50) NOT NULL COMMENT '测试计划集id'; +ALTER TABLE test_plan_api_scenario ADD COLUMN test_plan_collection_id VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '测试计划集id'; ALTER TABLE test_plan_api_scenario ADD COLUMN grouped BIT DEFAULT 0 COMMENT '是否为环境组'; ALTER TABLE test_plan_api_scenario MODIFY COLUMN `environment_id` VARCHAR(50) COMMENT '所属环境或环境组id'; ALTER TABLE test_plan_api_scenario ADD COLUMN last_exec_time BIGINT COMMENT '最后执行时间'; CREATE INDEX idx_test_plan_collection_id ON test_plan_api_scenario(test_plan_collection_id); CREATE INDEX idx_pos ON test_plan_api_scenario(pos); +-- 修改测试计划关联功能用例表字段 +ALTER TABLE test_plan_functional_case ADD COLUMN test_plan_collection_id VARCHAR(50) NOT NULL DEFAULT 'NONE' COMMENT '测试计划集id'; +CREATE INDEX idx_test_plan_collection_id ON test_plan_functional_case(test_plan_collection_id); + -- 修改测试规划配置表 ALTER TABLE test_plan_allocation DROP `run_mode_config`; ALTER TABLE test_plan_allocation ADD `test_resource_pool_id` VARCHAR(50) NOT NULL COMMENT '资源池ID'; diff --git a/backend/services/case-management/src/test/resources/dml/init_file_minder_test.sql b/backend/services/case-management/src/test/resources/dml/init_file_minder_test.sql index 37abced9db..35ad811ce2 100644 --- a/backend/services/case-management/src/test/resources/dml/init_file_minder_test.sql +++ b/backend/services/case-management/src/test/resources/dml/init_file_minder_test.sql @@ -50,9 +50,9 @@ VALUES INSERT INTO test_plan(id, num, 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, actual_end_time, description) VALUE ('TEST_MINDER_PLAN_ID_1', 1000, 'project-case-minder-test', 'none', 'TEST_MINDER_PLAN_MODULE', '脑图测试计划', 'PREPARED', 'TEST_PLAN', null, 1669174143999, 'admin', 1669174143999, 'admin', null, null, null,null,null); -INSERT INTO test_plan_functional_case(id, test_plan_id, functional_case_id, create_time, create_user, execute_user, last_exec_time, last_exec_result, pos) - VALUES ('test_plan_functional_case_minder_id1', 'TEST_MINDER_PLAN_ID_1', 'TEST_FUNCTIONAL_MINDER_CASE_ID_5', 1669174143999, 'admin', 'admin', 1669174143999, 'SUCCESS', 5000), - ('test_plan_functional_case_minder_id2', 'TEST_MINDER_PLAN_ID_1', 'TEST_FUNCTIONAL_MINDER_CASE_ID_5', 1669174143999, 'admin', 'admin', 1669174143999, 'SUCCESS', 10000); +INSERT INTO test_plan_functional_case(id, test_plan_id, functional_case_id, create_time, create_user, execute_user, last_exec_time, last_exec_result, pos, test_plan_collection_id) + VALUES ('test_plan_functional_case_minder_id1', 'TEST_MINDER_PLAN_ID_1', 'TEST_FUNCTIONAL_MINDER_CASE_ID_5', 1669174143999, 'admin', 'admin', 1669174143999, 'SUCCESS', 5000, '123'), + ('test_plan_functional_case_minder_id2', 'TEST_MINDER_PLAN_ID_1', 'TEST_FUNCTIONAL_MINDER_CASE_ID_5', 1669174143999, 'admin', 'admin', 1669174143999, 'SUCCESS', 10000, '123'); INSERT INTO custom_field (id, name, scene, type, remark, internal, scope_type, create_time, update_time, create_user, scope_id) VALUES ('custom_field_minder_gyq_id_2', 'functional_priority', 'FUNCTIONAL', 'SELECT', '', true, 'ORGANIZATION', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001'), diff --git a/backend/services/case-management/src/test/resources/dml/init_test_plan_case.sql b/backend/services/case-management/src/test/resources/dml/init_test_plan_case.sql index 999d6115b2..f65c6edfc3 100644 --- a/backend/services/case-management/src/test/resources/dml/init_test_plan_case.sql +++ b/backend/services/case-management/src/test/resources/dml/init_test_plan_case.sql @@ -15,7 +15,7 @@ INSERT INTO project(id, num, organization_id, name, description, create_time, up UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', 'admin', null, false, null, true, null); -INSERT INTO test_plan_functional_case(id, test_plan_id, functional_case_id, create_time, create_user, last_exec_time, last_exec_result, pos) -VALUES ('associate_case_plan_gyq_one','test_plan_associate_case_gyq_one', 'gyq_associate_function_case', UNIX_TIMESTAMP() * 1000, 'admin', UNIX_TIMESTAMP() * 1000, 'SUCCESS', 200), - ('associate_case_plan_gyq_three','test_plan_associate_case_gyq_one', 'gyq_associate_function_case', UNIX_TIMESTAMP() * 1000, 'admin', UNIX_TIMESTAMP() * 1000, 'SUCCESS', 200), - ('associate_case_plan_gyq_two','test_plan_associate_case_gyq_two', 'gyq_associate_function_case', UNIX_TIMESTAMP() * 1000, 'admin', UNIX_TIMESTAMP() * 1000, 'SUCCESS', 200); \ No newline at end of file +INSERT INTO test_plan_functional_case(id, test_plan_id, functional_case_id, create_time, create_user, last_exec_time, last_exec_result, pos, test_plan_collection_id) +VALUES ('associate_case_plan_gyq_one','test_plan_associate_case_gyq_one', 'gyq_associate_function_case', UNIX_TIMESTAMP() * 1000, 'admin', UNIX_TIMESTAMP() * 1000, 'SUCCESS', 200, '123'), + ('associate_case_plan_gyq_three','test_plan_associate_case_gyq_one', 'gyq_associate_function_case', UNIX_TIMESTAMP() * 1000, 'admin', UNIX_TIMESTAMP() * 1000, 'SUCCESS', 200, '123'), + ('associate_case_plan_gyq_two','test_plan_associate_case_gyq_two', 'gyq_associate_function_case', UNIX_TIMESTAMP() * 1000, 'admin', UNIX_TIMESTAMP() * 1000, 'SUCCESS', 200, '123'); \ No newline at end of file diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java index 1f387150f1..716fb1557d 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java @@ -46,7 +46,7 @@ public class TestPlanApiCaseController { public Pager> page(@Validated @RequestBody TestPlanApiCaseRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), StringUtils.isNotBlank(request.getSortString("id")) ? request.getSortString("id") : "create_time desc"); - return PageUtils.setPageInfo(page, testPlanApiCaseService.HasRelateApiCaseList(request, false)); + return PageUtils.setPageInfo(page, testPlanApiCaseService.hasRelateApiCaseList(request, false)); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/BasePlanCaseBatchRequest.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/BasePlanCaseBatchRequest.java index 5c3d7460b4..5fb13fd53e 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/BasePlanCaseBatchRequest.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/BasePlanCaseBatchRequest.java @@ -24,4 +24,7 @@ public class BasePlanCaseBatchRequest extends TableBatchProcessDTO implements Se @Schema(description = "模块id") private List moduleIds; + + @Schema(description = "计划集id") + private List collectionIds; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanCaseRequest.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanCaseRequest.java index 1aa14c053a..73ee9a3e38 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanCaseRequest.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/request/TestPlanCaseRequest.java @@ -33,4 +33,7 @@ public class TestPlanCaseRequest extends BasePageRequest implements Serializable @Schema(description = "模块id") private List moduleIds; + + @Schema(description = "计划集id") + private List collectionIds; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java index b521a79222..77f0ecc229 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/response/TestPlanApiCasePageResponse.java @@ -68,4 +68,7 @@ public class TestPlanApiCasePageResponse implements Serializable { @Schema(description = "计划集环境") private String collectEnvironmentId; + + @Schema(description = "报告id") + private String lastExecReportId; } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml index 6c76e728a6..b9dddeb9d5 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanApiCaseMapper.xml @@ -205,7 +205,7 @@ - + api_definition.name @@ -416,6 +416,7 @@ t.last_exec_result, t.execute_user, t.last_exec_time, + t.last_exec_report_id, tpc.environment_id as collectEnvironmentId FROM api_test_case atc diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanFunctionalCaseMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanFunctionalCaseMapper.xml index 5c8d529901..f3bd3fa5c9 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanFunctionalCaseMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanFunctionalCaseMapper.xml @@ -142,6 +142,12 @@ or functional_case.num like concat('%', #{request.keyword},'%') ) + + and test_plan_functional_case.test_plan_collection_id in + + #{collectionId} + + @@ -174,6 +180,12 @@ or functional_case.tags like concat('%', #{request.condition.keyword},'%') ) + + and test_plan_functional_case.test_plan_collection_id in + + #{collectionId} + + diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java index bcec19bff2..5eb4d72b9c 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java @@ -170,7 +170,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService { * @param deleted * @return */ - public List HasRelateApiCaseList(TestPlanApiCaseRequest request, boolean deleted) { + public List hasRelateApiCaseList(TestPlanApiCaseRequest request, boolean deleted) { List list = extTestPlanApiCaseMapper.relateApiCaseList(request, deleted); buildApiCaseResponse(list); return list; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCaseService.java index f9216374a7..8578cc4b00 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCaseService.java @@ -50,6 +50,8 @@ public class TestPlanCaseService { testPlanFunctionalCase.setLastExecResult(ExecStatus.PENDING.name()); testPlanFunctionalCase.setExecuteUser(associationParam.getOperator()); testPlanFunctionalCaseList.add(testPlanFunctionalCase); + // TODO 关联逻辑后续改进 默认先写死 + testPlanFunctionalCase.setTestPlanCollectionId("NONE"); pox += ServiceUtils.POS_STEP; } testPlanFunctionalCaseMapper.batchInsert(testPlanFunctionalCaseList); diff --git a/backend/services/test-plan/src/test/resources/dml/init_test_plan_association.sql b/backend/services/test-plan/src/test/resources/dml/init_test_plan_association.sql index ab34f5a733..7279f34e16 100644 --- a/backend/services/test-plan/src/test/resources/dml/init_test_plan_association.sql +++ b/backend/services/test-plan/src/test/resources/dml/init_test_plan_association.sql @@ -9,8 +9,8 @@ VALUES ('wxx_1', b'0', b'0', 100), ('wxx_2', b'0', b'0', 100); -INSERT INTO `test_plan_functional_case`(`id`, `test_plan_id`, `functional_case_id`, `create_time`, `create_user`, `execute_user`, `last_exec_time`, `last_exec_result`, `pos`) -VALUES ('wxx_tpfc_1', 'wxx_1', 'wxx_test_1', 1714980158000, 'admin', NULL, NULL, NULL, 1); +INSERT INTO `test_plan_functional_case`(`id`, `test_plan_id`, `functional_case_id`, `create_time`, `create_user`, `execute_user`, `last_exec_time`, `last_exec_result`, `pos`, `test_plan_collection_id`) +VALUES ('wxx_tpfc_1', 'wxx_1', 'wxx_test_1', 1714980158000, 'admin', NULL, NULL, NULL, 1, '123'); INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time) diff --git a/backend/services/test-plan/src/test/resources/dml/init_test_plan_case_relate_bug.sql b/backend/services/test-plan/src/test/resources/dml/init_test_plan_case_relate_bug.sql index 1667bdab74..49ba0b85ef 100644 --- a/backend/services/test-plan/src/test/resources/dml/init_test_plan_case_relate_bug.sql +++ b/backend/services/test-plan/src/test/resources/dml/init_test_plan_case_relate_bug.sql @@ -14,15 +14,15 @@ VALUES ('gyq_disassociate_plan_2', 25000, 'gyq_disassociate', 'gyq_test_plan_id_1', 'root', '测试取消关联2', 'PREPARED', 'TEST_PLAN', NULL, 1714980158000, 'WX', 1714980158000, 'WX', 1714980158000, 1714980158000, 1714980158000, 1714980158000, '11'); ; -INSERT INTO `test_plan_functional_case`(`id`, `test_plan_id`, `functional_case_id`, `create_time`, `create_user`, `execute_user`, `last_exec_time`, `last_exec_result`, `pos`) +INSERT INTO `test_plan_functional_case`(`id`, `test_plan_id`, `functional_case_id`, `create_time`, `create_user`, `execute_user`, `last_exec_time`, `last_exec_result`, `pos`, `test_plan_collection_id`) VALUES - ('relate_case_1', 'plan_1', 'fc_1', 1714980158000, 'admin', NULL, NULL, NULL, 1), - ('relate_case_2', 'plan_1', 'fc_2', 1714980158000, 'admin', NULL, NULL, NULL, 1), - ('relate_case_3', 'plan_2', 'fc_3', 1714980158000, 'admin', NULL, NULL, NULL, 1), - ('gyq_disassociate_case_1', 'gyq_disassociate_plan_1', 'gyq_disassociate_fc_1', 1714980158000, 'admin', NULL, NULL, NULL, 1), - ('gyq_disassociate_case_2', 'gyq_disassociate_plan_1', 'gyq_disassociate_fc_2', 1714980158000, 'admin', NULL, NULL, NULL, 1), - ('gyq_disassociate_case_3', 'gyq_disassociate_plan_1', 'gyq_disassociate_fc_3', 1714980158000, 'admin', NULL, NULL, NULL, 1), - ('gyq_disassociate_case_4', 'gyq_disassociate_plan_2', 'gyq_disassociate_fc_4', 1714980158000, 'admin', NULL, NULL, NULL, 1); + ('relate_case_1', 'plan_1', 'fc_1', 1714980158000, 'admin', NULL, NULL, NULL, 1, '123'), + ('relate_case_2', 'plan_1', 'fc_2', 1714980158000, 'admin', NULL, NULL, NULL, 1, '123'), + ('relate_case_3', 'plan_2', 'fc_3', 1714980158000, 'admin', NULL, NULL, NULL, 1, '123'), + ('gyq_disassociate_case_1', 'gyq_disassociate_plan_1', 'gyq_disassociate_fc_1', 1714980158000, 'admin', NULL, NULL, NULL, 1, '123'), + ('gyq_disassociate_case_2', 'gyq_disassociate_plan_1', 'gyq_disassociate_fc_2', 1714980158000, 'admin', NULL, NULL, NULL, 1, '123'), + ('gyq_disassociate_case_3', 'gyq_disassociate_plan_1', 'gyq_disassociate_fc_3', 1714980158000, 'admin', NULL, NULL, NULL, 1, '123'), + ('gyq_disassociate_case_4', 'gyq_disassociate_plan_2', 'gyq_disassociate_fc_4', 1714980158000, 'admin', NULL, NULL, NULL, 1, '123'); INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time) VALUES diff --git a/backend/services/test-plan/src/test/resources/dml/init_test_plan_report_gen.sql b/backend/services/test-plan/src/test/resources/dml/init_test_plan_report_gen.sql index 6ccaa0bc28..13996677f5 100644 --- a/backend/services/test-plan/src/test/resources/dml/init_test_plan_report_gen.sql +++ b/backend/services/test-plan/src/test/resources/dml/init_test_plan_report_gen.sql @@ -7,12 +7,12 @@ INSERT INTO `test_plan_config`(`test_plan_id`, `automatic_status_update`, `repea ('plan_id_for_gen_report_1', b'0', b'0', 0.00); -- 计划关联用例执行的测试数据 -INSERT INTO `test_plan_functional_case` (`id`, `test_plan_id`, `functional_case_id`, `create_time`, `create_user`, `execute_user`, `last_exec_time`, `last_exec_result`, `pos`) VALUES -('plan_id_for_gen_report_case_1', 'plan_id_for_gen_report', 'f1_gen', CURRENT_TIMESTAMP, 'admin', 'admin', CURRENT_TIMESTAMP, 'PENDING', 1), -('plan_id_for_gen_report_case_2', 'plan_id_for_gen_report', 'f2_gen', CURRENT_TIMESTAMP, 'admin', 'admin', CURRENT_TIMESTAMP, 'SUCCESS', 2), -('plan_id_for_gen_report_case_3', 'plan_id_for_gen_report', 'f3_gen', CURRENT_TIMESTAMP, 'admin', 'admin', CURRENT_TIMESTAMP, 'ERROR', 3), -('plan_id_for_gen_report_case_4', 'plan_id_for_gen_report', 'f4_gen', CURRENT_TIMESTAMP, 'admin', 'admin', CURRENT_TIMESTAMP, 'BLOCKED', 4), -('plan_id_for_gen_report_case_5', 'plan_id_for_gen_report', 'f5_gen', CURRENT_TIMESTAMP, 'admin', 'admin', CURRENT_TIMESTAMP, 'FAKE_ERROR', 5); +INSERT INTO `test_plan_functional_case` (`id`, `test_plan_id`, `functional_case_id`, `create_time`, `create_user`, `execute_user`, `last_exec_time`, `last_exec_result`, `pos`, `test_plan_collection_id`) VALUES +('plan_id_for_gen_report_case_1', 'plan_id_for_gen_report', 'f1_gen', CURRENT_TIMESTAMP, 'admin', 'admin', CURRENT_TIMESTAMP, 'PENDING', 1, '123'), +('plan_id_for_gen_report_case_2', 'plan_id_for_gen_report', 'f2_gen', CURRENT_TIMESTAMP, 'admin', 'admin', CURRENT_TIMESTAMP, 'SUCCESS', 2, '123'), +('plan_id_for_gen_report_case_3', 'plan_id_for_gen_report', 'f3_gen', CURRENT_TIMESTAMP, 'admin', 'admin', CURRENT_TIMESTAMP, 'ERROR', 3, '123'), +('plan_id_for_gen_report_case_4', 'plan_id_for_gen_report', 'f4_gen', CURRENT_TIMESTAMP, 'admin', 'admin', CURRENT_TIMESTAMP, 'BLOCKED', 4, '123'), +('plan_id_for_gen_report_case_5', 'plan_id_for_gen_report', 'f5_gen', CURRENT_TIMESTAMP, 'admin', 'admin', CURRENT_TIMESTAMP, 'FAKE_ERROR', 5, '123'); -- 计划关联缺陷的测试数据 INSERT INTO `bug_relation_case` (`id`, `case_id`, `bug_id`, `case_type`, `test_plan_id`, `test_plan_case_id`, `create_user`, `create_time`, `update_time`) VALUES diff --git a/backend/services/test-plan/src/test/resources/dml/init_test_plan_test.sql b/backend/services/test-plan/src/test/resources/dml/init_test_plan_test.sql index c0c0abd919..28a0a49a72 100644 --- a/backend/services/test-plan/src/test/resources/dml/init_test_plan_test.sql +++ b/backend/services/test-plan/src/test/resources/dml/init_test_plan_test.sql @@ -23,13 +23,13 @@ VALUES ('wx_test_plan_id_1', 5000, 'songtianyang-fix-wx', 'NONE', '1', '测试 1714980158000, 'WX', 1714980158000, 'WX', 1714980158000, 1714980158000, 1714980158000, 1714980158000, '11'); -INSERT INTO `test_plan_functional_case`(`id`, `test_plan_id`, `functional_case_id`, `create_time`, `create_user`, `execute_user`, `last_exec_time`, `last_exec_result`, `pos`) VALUES - ('wx_tpfc_1', 'wx_test_plan_id_4', 'wx_fc_1', 1714980158000, 'admin', NULL, NULL, NULL, 1), - ('oasis_1', 'wx_test_plan_id_7', 'oasis_fc_1', 1714980158000, 'admin', NULL, NULL, 'UN_EXECUTED', 1), - ('oasis_2', 'wx_test_plan_id_7', 'oasis_fc_2', 1714980158000, 'admin', NULL, NULL, 'PASSED', 1), - ('oasis_3', 'wx_test_plan_id_7', 'oasis_fc_3', 1714980158000, 'admin', NULL, NULL, 'FAILED', 1), - ('oasis_4', 'wx_test_plan_id_7', 'oasis_fc_4', 1714980158000, 'admin', NULL, NULL, 'BLOCKED', 1), - ('oasis_5', 'wx_test_plan_id_7', 'oasis_fc_5', 1714980158000, 'admin', NULL, NULL, 'FAKE_ERROR', 1); +INSERT INTO `test_plan_functional_case`(`id`, `test_plan_id`, `functional_case_id`, `create_time`, `create_user`, `execute_user`, `last_exec_time`, `last_exec_result`, `pos`, `test_plan_collection_id`) VALUES + ('wx_tpfc_1', 'wx_test_plan_id_4', 'wx_fc_1', 1714980158000, 'admin', NULL, NULL, NULL, 1, '123'), + ('oasis_1', 'wx_test_plan_id_7', 'oasis_fc_1', 1714980158000, 'admin', NULL, NULL, 'UN_EXECUTED', 1, '123'), + ('oasis_2', 'wx_test_plan_id_7', 'oasis_fc_2', 1714980158000, 'admin', NULL, NULL, 'PASSED', 1, '123'), + ('oasis_3', 'wx_test_plan_id_7', 'oasis_fc_3', 1714980158000, 'admin', NULL, NULL, 'FAILED', 1, '123'), + ('oasis_4', 'wx_test_plan_id_7', 'oasis_fc_4', 1714980158000, 'admin', NULL, NULL, 'BLOCKED', 1, '123'), + ('oasis_5', 'wx_test_plan_id_7', 'oasis_fc_5', 1714980158000, 'admin', NULL, NULL, 'FAKE_ERROR', 1, '123'); INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time) VALUES ('oasis_fc_1', 10001, 'TEST_MODULE_ID', 'project-associate-case-test', '100001', '测试', 'UN_REVIEWED', NULL, 'STEP', 0, 'v1.0.0', 'v1.0.0', 'PENDING', b'0', b'0', b'1', 'admin', 'admin', '', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL),