Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloundclassTest
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangying
cloundclassTest
Commits
58270bdc
Commit
58270bdc
authored
Jun 29, 2020
by
zhangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit
parents
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
send_clound_dingding.py
+55
-0
小麦云课堂.yml
+0
-0
No files found.
send_clound_dingding.py
0 → 100644
View file @
58270bdc
# @File : send_file_dingding.py
# @Author : ZY
# @Software: PyCharm
# @Time : 2020/4/29 17:34
import
json
import
requests
import
time
import
os
def
find_new_file
(
dir
):
# 查找目录下最新的文件
file_lists
=
os
.
listdir
(
dir
)
file_lists
.
sort
(
key
=
lambda
fn
:
os
.
path
.
getmtime
(
dir
+
"/"
+
fn
)
if
not
os
.
path
.
isdir
(
dir
+
"/"
+
fn
)
else
0
)
file
=
os
.
path
.
join
(
dir
,
file_lists
[
-
1
])
#print('最新的文件为: ' + file_lists[-1])
#print(file)
nowTime
=
time
.
strftime
(
'-
%
Y
%
m
%
d-
%
H:
%
M:
%
S'
,
time
.
localtime
(
time
.
time
()))
# 技术部群webhook
# url = 'https://oapi.dingtalk.com/robot/send?access_token=384b5298d49ee60e63a90b282b635b354b9d5464a4b312c4a42c13d0f3de9a4a'
# 自己的群webhook
url
=
'https://oapi.dingtalk.com/robot/send?access_token=5ab56cfdd624ca57b31eadc94abe041008b3ced874712e00cdf444adcacb3805'
# 技术部消息通知群webhook
# url = 'https://oapi.dingtalk.com/robot/send?access_token=1aa832980ed7ef71de3964f08ae1fe49f97e60f31bf700f500833ab50bbf2fa5'
HEADERS
=
{
"Content-Type"
:
"application/json ;charset=utf-8 "
}
data
=
{
"msgtype"
:
"markdown"
,
"markdown"
:
{
"title"
:
"线上 小麦云课堂列表接口回归测试"
,
"text"
:
"# 线上 小麦云课堂列表接口回归测试"
+
nowTime
+
"
\n
"
"> 
\n
"
"> ## 线上小麦云课堂接口 [点击查看详情](http://qa-results.ixm5.cn/automation_script_results/zhangying_reports/"
+
file_lists
[
-
1
]
+
")
\n
"
},
}
String_textMsg
=
json
.
dumps
(
data
)
res
=
requests
.
post
(
url
,
data
=
String_textMsg
,
headers
=
HEADERS
,
verify
=
False
)
print
(
res
.
text
)
os
.
system
(
"hrun 小麦云课堂接口测试.yml --report-dir /home/wwwroot/automation_script_results/zhangying_reports/"
);
dir
=
"/home/wwwroot/automation_script_results/zhangying_reports/"
find_new_file
(
dir
)
小麦云课堂.yml
0 → 100644
View file @
58270bdc
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment