|
@@ -18,7 +18,7 @@ jenkins_url = "http://121.229.175.82:63222/"
|
|
|
server = jenkins.Jenkins(jenkins_url, username='jiangwei', password='jW@123456') # Jenkins登录名 ,密码
|
|
|
|
|
|
# job名称
|
|
|
-job_name = "job/qccq/" # Jenkins运行任务名称
|
|
|
+job_name = "job/XCHY/" # Jenkins运行任务名称
|
|
|
# job的url地址
|
|
|
job_url = jenkins_url + job_name
|
|
|
# 获取最后一次构建
|
|
@@ -55,34 +55,34 @@ def DingTalkSend(info):
|
|
|
d.update({launch_name: num})
|
|
|
print(d)
|
|
|
f.close()
|
|
|
- retries_run = d.get('launch_retries_run') # 运行总数
|
|
|
- print('运行总数:{}'.format(retries_run))
|
|
|
- status_defects = d.get('launch_problems_test_defects') # 未执行数
|
|
|
- if status_defects is None:
|
|
|
- status_defects = "0"
|
|
|
- else:
|
|
|
- status_defects = status_defects
|
|
|
- print(status_defects)
|
|
|
- status_passed = d.get('launch_status_passed') # 通过数量
|
|
|
- print('通过数量:{}'.format(status_passed))
|
|
|
+ # retries_run = d.get('launch_retries_run') # 运行总数
|
|
|
+ # print('运行总数:{}'.format(retries_run))
|
|
|
+ # status_defects = d.get('launch_problems_test_defects') # 未执行数
|
|
|
+ # if status_defects is None:
|
|
|
+ # status_defects = "0"
|
|
|
+ # else:
|
|
|
+ # status_defects = status_defects
|
|
|
+ # print(status_defects)
|
|
|
+ # status_passed = d.get('launch_status_passed') # 通过数量
|
|
|
+ # print('通过数量:{}'.format(status_passed))
|
|
|
status_failed = d.get('launch_status_failed') # 不通过数量
|
|
|
print('不通过数量:{}'.format(status_failed))
|
|
|
out_time_url = str(read_yaml_out_time_url())
|
|
|
print(out_time_url)
|
|
|
# 钉钉推送
|
|
|
text = (
|
|
|
- f"<font color=\'#FFA500\'>[通知] </font>青春重庆-{info}报告"
|
|
|
- "\n\n用例运行总数: " + retries_run +
|
|
|
+ f"<font color=\'#FFA500\'>[通知] </font>星辰绘影-{info}报告"
|
|
|
+ "\n\n服务巡检情况: " + "正常" +
|
|
|
+ # "\n\n用例运行总数: " + retries_run +
|
|
|
# "\n\n用例未执行数: " + status_defects +
|
|
|
- "\n\n用例通过数量: " + status_passed +
|
|
|
- '''\n\n<font>用例失败数量: </font><font color=\'#FF0000\' size=2>%s</font> \n\n''' +
|
|
|
- "\n\n响应超过2s接口汇总:" + out_time_url +
|
|
|
- # "\n\n构建地址:\n" + job_url +
|
|
|
- "\n\n测试报告地址: \n" + report_url +
|
|
|
- "\n\n播报时间: " + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')) % (status_defects)
|
|
|
+ # "\n\n用例通过数量: " + status_passed +
|
|
|
+ # '''\n\n<font>用例失败数量: </font><font color=\'#FF0000\' size=2>%s</font> \n\n''' +
|
|
|
+ # "\n\n响应超过2s接口汇总:" + out_time_url +
|
|
|
+ # "\n\n测试报告地址: \n" + report_url +
|
|
|
+ "\n\n播报时间: " + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
|
|
|
|
|
dd_robot = DingtalkChatbot(read_config_yaml("dingding", "prod_webhook"))
|
|
|
- ret = dd_robot.send_markdown(title='青春重庆', text=text, is_at_all=False)
|
|
|
+ ret = dd_robot.send_markdown(title='星辰绘影服务巡检', text=text, is_at_all=False)
|
|
|
print(ret)
|
|
|
|
|
|
|
|
@@ -108,4 +108,4 @@ def dingtalk_send_warning(msg):
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
# dingtalk_send_warning("测试")
|
|
|
- DingTalkSend("生产APP巡检")
|
|
|
+ DingTalkSend("服务巡检")
|