如何通过源码生成Gatling可执行工具

发表于:2018-7-31 15:10

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:shihuc    来源:博客园

  其实,这个对于不是很熟系sbt的人来说,或者对scala语言没有什么了解的人,接触Gatling这个开源的性能测试框架,还是有些茫然的。
  因为GitHub上提供的Gatling (最新版本:2.2.0 snapshot)是源码,而且,完整的Gatling被拆分为Gatling(Core,相当于测试引擎吧)和Gatling-highchats(主要是用来生成测试报告)两部分。不知到为何要拆分为两部分,也许是因为Gatling-highchats部分引用了特殊license的软件插件(HighCharts & HighStock, 来自于HighSoft公司。)
  1. 首先,从github上clone下gatling的源码。
  git clone http://github.com/gatling/gatling
  git clone http://github.com/gatling/gatling-highcharts
  待这些文件都下载到本地后,先进入gatling的目录,在命令行下执行 sbt compile (,若你的系统下没有安装SBT,请先自己安装,我是直接在SBT官网下载的0.13.9的版本,解压到local目录下,再在/etc/profile下配置一下环境变量,方便使用)。gatling文件列表如下:
  -rw-r--r-- 1 root root 3204 Jan  8 13:10 CONTRIBUTING.md
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-app
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-bundle
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-charts
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-commons
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-compiler
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-core
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-http
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-jdbc
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-jms
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-metrics
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-recorder
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-redis
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 gatling-test-framework
  -rwxr-xr-x 1 root root  246 Jan  8 13:10 make_credentials.sh
  -rw-r--r-- 1 root root  106 Jan  8 13:10 pgp.sbt
  drwxr-xr-x 4 root root 4096 Jan  8 13:12 project
  -rw-r--r-- 1 root root 2304 Jan  8 13:10 README.md
  drwxr-xr-x 4 root root 4096 Jan  8 13:10 src
  drwxr-xr-x 4 root root 4096 Jan  8 13:18 target
  -rwxr-xr-x 1 root root  720 Jan  8 13:10 trigger_build.py
  -rw-r--r-- 1 root root   40 Jan  8 13:10 version.sbt
  sbt compile执行完毕后(可能需要一段时间,因为有些依赖的库要下载),需要将其发布到ivy仓库中(你也可以发布到mave仓库):
上文内容不用于商业目的,如涉及知识产权问题,请权利人联系博为峰小编(021-64471599-8017),我们将立即处理。

21/212>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号