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

问题描述

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

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

我在 yslow 的闪电演讲中看到它可以使用 CI 实现,但它没有提供太多关于如何执行此操作的信息.我在谷歌上搜索了很多 yslow 和 CI 或 jenkins,但一直找不到任何东西.

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?

推荐答案

抱歉,好像 有人毁坏了 YSlowPahntomJS wiki 页面 但它又回来了,请访问:https://github.com/marcelduran/yslow/wiki/PhantomJS

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

有 Jenkins 屏幕截图,但没有分步集成,我只是用以下内容更新了 wiki:

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

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

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

在上面一行:

  • PhantomJS 脚本的 YSlow 位于 /tmp/yslow.js
  • -igrade 指定所有的规则都会被测试
  • -threshold "B" 指定所有规则的最低可接受分数以及总分
  • -f junit 指定Jenkins的输出格式
  • http://built-url-here 是您的项目可访问的构建页面 url
  • yslow.xml是junit格式的输出结果
  • 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

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

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 点击 http://built-page-here >yslow.tap在上面一行:

  • PhantomJS 脚本的 YSlow 位于 /tmp/yslow.js
  • -igrade 指定所有的规则都会被测试
  • -threshold "B" 指定所有规则的最低可接受分数以及总分
  • -f tap 指定TAP Jenkins插件的输出格式
  • http://built-url-here 是您的项目可访问的构建页面 url
  • yslow.tap是TAP格式的输出结果
  • 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

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

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