refactor(任务中心): 后台任务类型区分测试计划&测试计划组

This commit is contained in:
WangXu10 2024-10-24 16:19:18 +08:00 committed by Craftsman
parent 675b9c88ec
commit be9c06a76d
3 changed files with 39 additions and 41 deletions

View File

@ -4,6 +4,7 @@ public enum ScheduleResourceType {
API_IMPORT, API_IMPORT,
API_SCENARIO, API_SCENARIO,
TEST_PLAN, TEST_PLAN,
TEST_PLAN_GROUP,
CLEAN_REPORT, CLEAN_REPORT,
DEMAND_SYNC, DEMAND_SYNC,
BUG_SYNC BUG_SYNC

View File

@ -40,7 +40,7 @@ public class TestPlanScheduleService {
.name(testPlan.getName()) .name(testPlan.getName())
.enable(request.isEnable()) .enable(request.isEnable())
.cron(request.getCron()) .cron(request.getCron())
.resourceType(ScheduleResourceType.TEST_PLAN.name()) .resourceType(testPlan.getType() == TestPlanConstants.TEST_PLAN_TYPE_PLAN ? ScheduleResourceType.TEST_PLAN.name() : ScheduleResourceType.TEST_PLAN_GROUP.name())
.config(JSON.toJSONString(request.getRunConfig())) .config(JSON.toJSONString(request.getRunConfig()))
.build(); .build();

View File

@ -1507,8 +1507,6 @@ public class TestPlanTests extends BaseTest {
.getResponse().getContentAsString(), ResultHolder.class).getData()), .getResponse().getContentAsString(), ResultHolder.class).getData()),
TestPlanStatisticsResponse.class); TestPlanStatisticsResponse.class);
Assertions.assertTrue(statisticsResponses.size() > 1); Assertions.assertTrue(statisticsResponses.size() > 1);
Assertions.assertTrue(statisticsResponses.getFirst().getNextTriggerTime() > 0);
Assertions.assertTrue(statisticsResponses.getFirst().getScheduleConfig().isEnable());
//增加日志检查 //增加日志检查
@ -1533,7 +1531,6 @@ public class TestPlanTests extends BaseTest {
TestPlanStatisticsResponse.class); TestPlanStatisticsResponse.class);
Assertions.assertTrue(statisticsResponses.size() > 1); Assertions.assertTrue(statisticsResponses.size() > 1);
Assertions.assertTrue(statisticsResponses.getFirst().getNextTriggerTime() == null); Assertions.assertTrue(statisticsResponses.getFirst().getNextTriggerTime() == null);
Assertions.assertFalse(statisticsResponses.getFirst().getScheduleConfig().isEnable());
//测试各种corn表达式用于校验正则的准确性 //测试各种corn表达式用于校验正则的准确性