如何通过 Jenkins 运行 Dojo DOH 单元测试?
有人尝试过将 Dojo DOH 单元测试与 Jenkins 集成吗?
我想做以下事情,但如果已经完成了,我不想重新发明它。所以,我在想:
- 从 Jenkins 中的构建后步骤开始 DOH 测试并等待结果
- 在无头浏览器(例如 Crowbar)中运行测试本身
- 从返回的 HTML 中解析成功/错误计数作者:Crowbar
- 找到(或编写)一个 Jenkins 插件,该插件将 (a) 如果测试失败,则构建失败,(b) 呈现测试结果,(c) 可能将结果集成到 CI 游戏插件中
问题:
- 之前是否这样做过?
- 你觉得上面的大纲有什么问题吗?
- 你知道有一个 Jenkins 插件可以提供帮助吗?或者我必须构建自己的插件?
Has anyone tried integrating Dojo DOH unit-tests with Jenkins?
I'd like to do the following, but don't want to reinvent it if this has already been done. So, I'm thinking:
- Kick off the DOH-tests from a post-build step in Jenkins and wait for the results
- Run the tests themselves in a headless-browser (e.g. Crowbar)
- Parse the succes/error-count from the HTML returned by Crowbar
- Find (or write) a Jenkins plugin that will (a) fail the build if there are failing tests, (b) render the test results, (c) possibly integrate results into the CI game plugin
Questions:
- Has this been done before?
- Do you see any issues with the outline above?
- Do you know of a Jenkins plugin that will help, or will I have to build my own?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
1. 自动化 Dojo 测试 - DOH 和 Dojo Selenium-RC (Rob Coup - 2008/01/03)
2. 我觉得很合理。
3. Jenkins Selenium 插件
1. Automated Dojo testing - DOH & Selenium-RC (Rob Coup - 2008/01/03)
2. Seems reasonable to me.
3. Jenkins Selenium plugin
为了运行 DOH 测试,我开发了一个集成到 ci 中并可以启动浏览器的工具。
http://codeblog.bigbrowser.net/dojo-testing-doh- with-continuous-integration/
也许你也可以尝试一下。
我已经解释了在哪里下载以及如何运行它。
For running the D.O.H tests i have developed a tool which integrates into ci and can start the browser.
http://codeblog.bigbrowser.net/dojo-testing-d-o-h-with-continuous-integration/
Maybee you can give this also a try.
I have explained there where to download and how to run it.
以下是我使用 HTMLUnit 的方法。不需要硒。
它作为常规 JUnit 测试运行(可以轻松地由 CI 服务器自动运行),并在测试失败时打印出 DOH 日志。
下面是 runTests.html 的内容。它基本上只是重定向到 DOJO 测试运行程序,其中包含特定于我们要测试的目录中的测试的参数。
这是一种构建事物的好方法,您也可以在 JUnit 测试的 PATHNAME 字段中指定此 URL。
Here's how I did it with HTMLUnit. No Selenium required.
It runs as a regular JUnit test (which can easily be run automatically by your CI Server), and prints out the DOH log if there is a test failure.
And below is the content of runTests.html. It basically just redirects to the DOJO test runner, with parameters specific to the tests in the directory we want to test.
It's just a nice way to structure things, you could alternatively have specified this URL in the PATHNAME field in the JUnit test.