栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

diffy-MAC本地实践记录

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

diffy-MAC本地实践记录

原理:​​​​​​测试利器 | 一款开源的Diffy自动化测试框架:超详细实战教程讲解_狂师vs的博客-CSDN博客

下面记录一下在本地初次使用diffy的过程,主要有以下几个步骤:首先是,在本地部署difty, 然后在docker中安装稳定版本、稳定版本副本、测试版本的服务。最后,在本地终端向diffty代理发起请求,在locolhost:8888查看diff结果。

1、下载diffy

git clone https://github.com/opendiffy/diffy

2、本地部署diffy

cd diffy
./sbt assembly

java -jar ./target/scala-2.12/diffy-server.jar
-candidate='localhost:9002'
-master.primary='localhost:9000'
-master.secondary='localhost:9001'
-responseMode='candidate'
-service.protocol='http'
-serviceName='ExampleService'
-summary.delay='1'
-summary.email='xxx@qq.com
-maxHeaderSize='32.kilobytes'
-maxResponseSize='5.megabytes'
-proxy.port=:8880
-admin.port=:8881
-http.port=:8888 &

其中,

-candidate='localhost:9002'   为部署的测试版本的ip+port

-master.primary='localhost:9000 为部署的稳定版的ip+port

-master.secondary='localhost:9001' 为部署的稳定版本副本的ip+port

3、部署3个版本的服务

(1)安装docker 

brew install --cask --appdir=/Applications docker

参考:​​​​​​MacOS Docker 安装 | 菜鸟教程

(2)拉取diffy例子的2个版本代码的镜像

docker pull diffy/example-service: production
docker pull diffy/example-service: candidate

(3) 使用docker启动容器:9990为稳定版本,9991为稳定副本,9992为测试版本

docker run -d --name exd-primary  -p 9990:5000 diffy/example-service:production
docker run -d --name exd-secondary -p 9991:5000 diffy/example-service:production
docker run -d --name exd-candidate -p 9992:5000 diffy/example-service:candidate 

4、向diffy代理地址发起请求

curl 'http://localhost:8880/noise?value=happy-tester' -H 'Canonical-Resource:endpoint-test'
curl 'http://localhost:8880/regression?value=happy-tester' -H 'Canonical-Resource:endpoint-test'
curl 'http://localhost:8880/noisy_regression?value=happy-tester' -H 'Canonical-Resource:endpoint-test'

5、本地浏览器打开 http://localhost:8888/ ,查看结果

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/946089.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号