当前位置:网站首页>接口差异测试——Diffy工具
接口差异测试——Diffy工具
2022-07-02 22:41:00 【敏敏1020】
一、Diffy工作原理
二、Diffy使用
克隆源码:
git clone https://github.com/twitter/diffy.git
构建diffy-server.jar,依次执行以下两条命令
cd diffy ./sbt assembly
启动diffy服务
- http接口启动diffy命令
java -jar diffy-server.jar -candidate=localhost:8080 -master.primary=localhost:8081 -master.secondary=localhost:8082 -service.protocol=http -serviceName=My-Service -proxy.port=:8880 -admin.port=:8881 -http.port=:8888 -rootUrl='localhost:8888'
- https接口启动diffy命令(亲测可用,搞了很久)
java -jar diffy-server.jar -candidate=www.baidu.test -master.primary=www.baidu.com -master.secondary=www.baidu.com -service.protocol=https -serviceName=My-Service -proxy.port=:9990 -admin.port=:9991 -http.port=:8888 -rootUrl='localhost:8888' -summary.email='[email protected]' -summary.delay="5" -allowHttpSideEffects=true -excludeHttpHeadersComparison='true'
参数说明
参数 说明 -candidate=www.baidu.test 待上线版本的ip或域名。
假如百度测试环境的host为www.baidu.test
-master.primary=www.baidu.com 已上线版本的ip1或域名1 -master.secondary=www.baidu.com 已上线版本的ip2或域名2 -service.protocol=https http协议或https协议 -serviceName=My-Service 服务名称。任意写 -proxy.port=:9990 代理端口。所有请求应从这个端口访问。如:curl localhost:9990/search/1 -admin.port=:9991 -http.port=:8888 diffy报告端口。localhost:8888 -rootUrl='localhost:8888' 同上 -summary.email='[email protected]' 报告邮件收件地址 -summary.delay="5" -allowHttpSideEffects=true diffy考虑到安全性,post、put、delete请求默认忽略。设置为true可使这些类型请求仍能正常代理发送 -excludeHttpHeadersComparison='true' 是否排除header的差异。一般设置为true。不同服务的header有所差别,可忽略 踩坑说明!!!
- responseMode=primary:有一些文章里写到参数包含responseMode,但是执行时会报错:。报错信息里提示并没有该参数,去掉这一项就不会报错。
- excludeHttpHeadersComparison=false:此参数执行时报错:。解决方法:给false加上双引号,即excludeHttpHeadersComparison="false"
- http接口启动diffy命令
diffy报告
- localhost:8888,浏览器访问该地址,即可查看diffy报告。
- 报告示例
边栏推荐
- A single element in an ordered array -- Valentine's Day mental problems
- Flexible combination of applications is a false proposition that has existed for 40 years
- 基于OpenCV实现口罩识别
- MarkDown基本语法
- @BindsInstance在Dagger2中怎么使用
- JDBC Exercise case
- How to maintain the brand influence of clothing enterprises
- leetcode 650. 2 keys keyboard with only two keys (medium)
- Data set - fault diagnosis: various data and data description of bearings of Western Reserve University
- 【OJ】两个数组的交集(set、哈希映射 ...)
猜你喜欢
Use redis to realize self increment serial number
How to set automatic reply for mailbox and enterprise mailbox?
Highly available cluster (HAC)
Compose 中的 'ViewPager' 详解 | 开发者说·DTalk
Container runtime analysis
Markdown basic grammar
Win11麦克风测试在哪里?Win11测试麦克风的方法
Speech recognition Series 1: speech recognition overview
JDBC Exercise case
95页智慧教育解决方案2022
随机推荐
Go basic data type
Implementation of VGA protocol based on FPGA
leetcode 650. 2 Keys Keyboard 只有两个键的键盘(中等)
理想汽车×OceanBase:当造车新势力遇上数据库新势力
What if win11 can't turn off the sticky key? The sticky key is cancelled but it doesn't work. How to solve it
Container runtime analysis
JDBC教程
Speech recognition Series 1: speech recognition overview
Mapper agent development
JDBC練習案例
Difference between NVIDIA n card and amda card
Print out mode of go
The use of 8255 interface chip and ADC0809
Why does RTOS system use MPU?
CADD course learning (4) -- obtaining proteins without crystal structure (Swiss model)
vim区间删行注释
[ml] Li Hongyi III: gradient descent & Classification (Gaussian distribution)
PR FAQ, what about PR preview video card?
【OJ】两个数组的交集(set、哈希映射 ...)
Data set - fault diagnosis: various data and data description of bearings of Western Reserve University