Configuring yslow on Jenkins

江枫思渺然 提交于 2019-12-04 15:57:08

问题


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?


回答1:


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.tap 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 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.




来源:https://stackoverflow.com/questions/11419284/configuring-yslow-on-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!