在Jenkins上配置yslow

Bra*_*ile 1 continuous-integration yslow jenkins

我可以帮助配置Jenkins使用yslow吗?

我在yslow的闪电演讲中看到它可以通过CI实现,但它没有提供有关如何实现这一目标的非常多的信息.我已经在google上搜索了yslow和CI或jenkins,并且一直无法找到任何东西.

有人能指出我正确的方向吗?

mar*_*ran 6

对不起,好像有人为PahntomJS wiki页面销毁了YSlow,但它又回来了,请查看:https://github.com/marcelduran/yslow/wiki/PhantomJS

有Jenkins截图但没有逐步集成,我刚刚用以下内容更新了wiki:


一旦你安装Jenkins,PhantomJS和PhantomJS的YSlow并正常工作,只需将以下shell命令添加到你的构建过程中:

phantomjs /tmp/yslow.js -i grade -threshold "B" -f junit http://built-page-here > yslow.xml

在上面:

  • YSlow for PhantomJS脚本位于 /tmp/yslow.js
  • -i grade 指定将测试所有规则
  • -threshold "B" 指定所有规则的最低可接受分数以及总分
  • -f junit 指定Jenkins的输出格式
  • http://built-url-here 是您项目的可访问构建页面URL
  • yslow.xml 是junit格式的输出结果

如果您安装了TAP插件(通过Jenkins插件管理器),您可以替换上面的行或添加另一个测试,如下所示:

phantomjs /tmp/yslow.js -i grade -threshold "B" -f tap http://built-page-here > yslow.tap 在上面:

  • YSlow for PhantomJS脚本位于 /tmp/yslow.js
  • -i grade 指定将测试所有规则
  • -threshold "B" 指定所有规则的最低可接受分数以及总分
  • -f tap 指定TAP Jenkins插件的输出格式
  • http://built-url-here 是您项目的可访问构建页面URL
  • yslow.tap 是TAP格式的输出结果

确保在指向输出测试结果文件的构建后操作中发布JUnit和/或TAP结果报告,例如:yslow.xml,yslow.tap等.