本文介绍了在Jenkins上配置yslow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在配置Jenkins使用yslow时获得一些帮助吗?



我在yslow的闪电演讲中看到它可以用CI实现,但它没有提供很多关于如何做的信息。我做了相当多的搜索在谷歌的yslow和CI或jenkins,并已经找不到任何东西。



任何人都能指向正确的方向?

解决方案

,似乎,但它又回来了,请查看:



有Jenkins的屏幕截图,但没有一步一步的集成,我只是更新了维基的以下:






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



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



上面:




  • YSlow for PhantomJS script位于 /tmp/yslow.js

  • -i grade 指定将测试所有规则

  • -thresholdB作为总分

  • -f junit 指定Jenkins的输出格式

  • http:// built-url-here 是您的项目可访问的页面网址

  • yslow.xml 是junit格式的输出结果



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



phantomjs /tmp/yslow.js -i grade -thresholdB http:// built-page-here> yslow.tap
上面的行:




  • PhantomJS脚本的YSlow位于 /tmp/yslow.js

  • -i grade 指定将测试所有规则

  • -thresholdB指定所有规则的最低可接受分数以及整体分数

  • -f tap 指定TAP Jenkins插件的输出格式

  • http: url-here 是您的项目可访问的内置网址。

  • yslow.tap 以TAP格式



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





Could I get some help on configuring Jenkins to use yslow?

I saw on the lightning speach for yslow that it can be implemented with CI, but it didn't give very much information on how one would go about doing this. I've done quite a bit of searching on google for yslow and CI or jenkins, and have been unable to find anything.

Could anyone point me in the right direction?

解决方案

Sorry, seem like someone destroyed YSlow for PahntomJS wiki page but it's back again, check it out at: https://github.com/marcelduran/yslow/wiki/PhantomJS

There was Jenkins screenshot but no step-by-step integration, I just updated the wiki with the following:


Once you have Jenkins, PhantomJS and YSlow for PhantomJS installed and working properly, just add the following shell command into your building process:

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

In line above:

  • YSlow for PhantomJS script is located at /tmp/yslow.js
  • -i grade specifies that all rules will be tested
  • -threshold "B" specifies the lowest acceptable score for all rules as well as overall score
  • -f junit specifies the output format for Jenkins
  • http://built-url-here is the reachable built page url of your project
  • yslow.xml is the output results in junit format

If you have TAP plugin installed (via Jenkins plugin manager), you can replace the line above or add another test as follows:

phantomjs /tmp/yslow.js -i grade -threshold "B" -f tap http://built-page-here > yslow.tapIn line above:

  • YSlow for PhantomJS script is located at /tmp/yslow.js
  • -i grade specifies that all rules will be tested
  • -threshold "B" specifies the lowest acceptable score for all rules as well as overall score
  • -f tap specifies the output format for TAP Jenkins plugin
  • http://built-url-here is the reachable built page url of your project
  • yslow.tap is the output results in TAP format

Make sure you publish JUnit and/or TAP results report in the post-build actions pointing to the output test results file(s), e.g: yslow.xml, yslow.tap, etc.


这篇关于在Jenkins上配置yslow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 10:16