Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
willdesk_apiauto
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
29
Issues
29
List
Boards
Labels
Service Desk
Milestones
Merge Requests
29
Merge Requests
29
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
桦生 詹
willdesk_apiauto
Commits
86f349c5
Commit
86f349c5
authored
May 10, 2024
by
zhanhuasheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、数据库修改地址
2、告警时间调整
parent
fad1116c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
Config/base_config.ini
Config/base_config.ini
+3
-3
Utils/req_handler.py
Utils/req_handler.py
+5
-3
No files found.
Config/base_config.ini
View file @
86f349c5
...
...
@@ -27,13 +27,13 @@ formal_password = 123456789A
address
=
47.251.1.100
#端口
port
=
3306
port
=
1
3306
#账号
account
=
willdesk
account
=
root
#密码
password
=
uitSElgrwLp6vFG
password
=
YKp-gmG28isz5qX
[rerun]
rerun
=
1
...
...
Utils/req_handler.py
View file @
86f349c5
...
...
@@ -2,6 +2,8 @@ import time
import
jsonpath
import
pymysql.err
import
warnings
import
pytest
import
requests
import
re
import
os
...
...
@@ -141,9 +143,9 @@ class ReqHandler:
try
:
assert
res
.
status_code
==
200
#先断言状态码是正确的
time
=
res
.
elapsed
.
total_seconds
()
if
time
>=
4
:
warnings
.
warn
(
f
'接口响应时间过长,耗时
{
time
}
秒'
)
logger
.
error
(
f
'接口响应时间过长,耗时
{
time
}
秒'
)
if
time
>=
5
:
warnings
.
warn
(
f
'接口响应时间过长,耗时
{
str
(
time
)
}
秒'
,
RuntimeWarning
)
#告警接口耗时过长
logger
.
error
(
f
'接口响应时间过长,耗时
{
str
(
time
)
}
秒'
)
if
isinstance
(
expected
,
list
):
'''
穿进来的expected一定是 {"eq":{$.code : value}} 的形式,要断言的值一定是通过jsonpath去检索的
...
...
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