From d2311c85de0f925a2130500c3e818807c35c8680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AD=A6=E5=B3=B0?= Date: Thu, 29 Sep 2022 15:13:58 +0800 Subject: [PATCH] feature: create tone job by tsn for visitor --- models/task_model.py | 1 + services/plan_service.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/models/task_model.py b/models/task_model.py index 77d0a55..0064261 100644 --- a/models/task_model.py +++ b/models/task_model.py @@ -23,6 +23,7 @@ class Task(CommonModel): device_ip = Column(String(256), nullable=True, default='-', comment='测试机器IP') cluster = Column(String(256), nullable=True, default='', comment='测试机器集群名称') tags = Column(String(256), nullable=True, default='', comment='测试机器标签') + tsn = Column(String(256), nullable=True, default='', comment='测试机器tsn') workspace = Column(String(128), nullable=False, comment='tone workspace') project = Column(String(128), nullable=False, comment='tone project') job_type = Column(String(128), nullable=False, comment='tone job type') diff --git a/services/plan_service.py b/services/plan_service.py index 7d8e912..b4826b2 100644 --- a/services/plan_service.py +++ b/services/plan_service.py @@ -222,6 +222,8 @@ async def __start_auto_task(auto_tasks): case_obj['server'] = {'ip': task.cluster} if task.tags: case_obj['server'] = {'tags': task.tags} + if task.tsn: + case_obj['server'] = {'tsn': task.tsn} suite_dict[suite_name].append(case_obj) for key, value in suite_dict.items(): test_config.append({ @@ -408,6 +410,11 @@ async def make_a_copy(plan_id, user_infos): task['status'] = Status_EN.INIT.value task['plan_id'] = new_plan.id task['plan_title'] = new_plan.title + if user_infos['role'] == User_Role.VISITOR: + task['tsn'] = user_infos['nick_name'] + task['device_ip'] = '' + task['tags'] = '' + task['cluster'] = '' del task['id'] del task['gmt_modified'] del task['gmt_created'] -- Gitee