Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
泰斯特Test
Taisite-Platform
提交
d045dc35
T
Taisite-Platform
项目概览
泰斯特Test
/
Taisite-Platform
8 个月 前同步成功
通知
121
Star
28
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Taisite-Platform
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d045dc35
编写于
2月 21, 2021
作者:
泰斯特Test
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add global_vars_map
上级
e2f94f25
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
5 deletion
+11
-5
backend/utils/cron/cronManager.py
backend/utils/cron/cronManager.py
+3
-0
backend/utils/cron/interfaceTestCron.py
backend/utils/cron/interfaceTestCron.py
+8
-5
未找到文件。
backend/utils/cron/cronManager.py
浏览文件 @
d045dc35
...
...
@@ -91,6 +91,7 @@ class CronManager:
is_execute_forbiddened_case
=
cron_info
.
get
(
'isExecuteForbiddenedCase'
)
test_case_id_list
=
cron_info
.
get
(
'testCaseIdList'
)
test_domain
=
cron_info
.
get
(
'testDomain'
)
global_vars_id
=
cron_info
.
get
(
'globalVarsId'
)
alarm_mail_list
=
cron_info
.
get
(
'alarmMailList'
)
is_ding_ding_notify
=
cron_info
.
get
(
'isDingDingNotify'
)
ding_ding_access_token
=
cron_info
.
get
(
'dingdingAccessToken'
)
...
...
@@ -112,6 +113,7 @@ class CronManager:
cron
=
Cron
(
test_case_suite_id_list
=
test_case_suite_id_list
,
is_execute_forbiddened_case
=
is_execute_forbiddened_case
,
test_domain
=
test_domain
,
global_vars_id
=
global_vars_id
,
alarm_mail_list
=
alarm_mail_list
,
is_ding_ding_notify
=
is_ding_ding_notify
,
ding_ding_access_token
=
ding_ding_access_token
,
...
...
@@ -127,6 +129,7 @@ class CronManager:
cron
=
Cron
(
test_case_suite_id_list
=
test_case_suite_id_list
,
is_execute_forbiddened_case
=
is_execute_forbiddened_case
,
test_domain
=
test_domain
,
global_vars_id
=
global_vars_id
,
alarm_mail_list
=
alarm_mail_list
,
is_ding_ding_notify
=
is_ding_ding_notify
,
ding_ding_access_token
=
ding_ding_access_token
,
...
...
backend/utils/cron/interfaceTestCron.py
浏览文件 @
d045dc35
...
...
@@ -5,6 +5,7 @@ from models.mailSender import MailSender
from
testframe.interfaceTest.tester
import
tester
from
models.testReport
import
TestReport
from
models.project
import
Project
from
models.testDataStorage
import
TestDataStorage
import
pymongo
from
bson
import
ObjectId
import
datetime
...
...
@@ -22,8 +23,8 @@ class Cron:
def
__init__
(
self
,
cron_name
,
test_case_suite_id_list
,
test_domain
,
trigger_type
,
is_execute_forbiddened_case
=
False
,
test_case_id_list
=
None
,
alarm_mail_list
=
None
,
is_ding_ding_notify
=
False
,
ding_ding_access_token
=
None
,
ding_ding_notify_strategy
=
None
,
is_enterprise_wechat_notify
=
False
,
enterprise_wechat_access_token
=
None
,
enterprise_wechat_notify_strategy
=
None
,
is_web_hook
=
False
,
retry_limit
=
3
,
retry_interval
=
60
,
global_vars
=
None
,
**
trigger_args
):
enterprise_wechat_notify_strategy
=
None
,
is_web_hook
=
False
,
retry_limit
=
3
,
retry_interval
=
60
,
global_vars_id
=
None
,
**
trigger_args
):
if
test_case_id_list
is
None
:
test_case_id_list
=
[]
...
...
@@ -81,7 +82,7 @@ class Cron:
self
.
retry_limit
=
retry_limit
# 定时任务报错后重试次数限制
self
.
retry_interval
=
retry_interval
# 定时任务报错后重试时间间隔
self
.
global_vars
=
global_vars
if
global_vars
else
{}
self
.
global_vars
_id
=
global_vars_id
if
global_vars_id
else
None
def
get_cron_test_cases_list
(
self
):
if
not
self
.
is_execute_forbiddened_case
:
...
...
@@ -224,11 +225,13 @@ class Cron:
else
:
raise
TypeError
(
'定时任务执行中未找到任何可执行用例!'
)
_global_vars
=
self
.
global_vars
if
hasattr
(
self
,
'global_vars'
)
else
{}
# 查找数据字典
global_vars_map
=
TestDataStorage
.
find_one
({
'_id'
:
ObjectId
(
self
.
global_vars_id
)}).
get
(
'dataMap'
,
{})
\
if
self
.
global_vars_id
else
{}
tester_for_cron
=
tester
(
test_case_list
=
cron_test_cases_list
,
domain
=
self
.
test_domain
,
global_vars
=
_global_vars
)
global_vars
=
global_vars_map
)
total_test_start_time
=
time
.
time
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录