如何在 sbt 中设置多阶段测试管道?
具体来说,对于 Scalatra 项目,但这个问题可能适用于大多数项目。
例如,我通常想要运行:
- 单元测试
- 代码质量检查(覆盖率、重复、复杂性、jsLint!)
- 集成测试(不要太多!)
- 验收测试(通常是“预签入”子集)
- 回归测试(基本上相同)作为验收测试,但更大的集合)
- 性能测试
我想按上下文运行这些测试的不同子集 - 即在简单的代码更改之后我可能只运行前三个;在签入之前,我可能想运行一个更大的集合,并且持续集成服务器可能有一个“快速”和一个“慢速”构建,其中有更大的集合。
基本的 sbt 文档似乎假设有一个“测试”目标 - 是否有推荐的方法来实现这样的多个测试阶段?
Specifically, for a Scalatra project, but the question probably applies to most.
For example, I typically want to run:
- unit tests
- code quality checks (coverage, duplication, complexity, jsLint!)
- integration tests (not too many!)
- acceptance tests (usually a "pre-checkin" subset)
- regression tests (basically the same as acceptance tests, but a bigger set)
- performance tests
I want to run different subsets of these by context - i.e. after a simple code change I might just run the first three; before checking in I might want to run a bigger set, and the Continuous Integration server might have a "fast" and a "slow" build that have even bigger sets.
The basic sbt docs seem to assume a single "test" target - is there a recommended way to implement multiple test phases like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想查看有关使用 SBT 和 Hudson 进行集成测试的博客:
http://henkelmann。 eu/2010/11/14/sbt_hudson_with_test_integration
然后,要添加您自己的操作,您可以使用此页面:
http://code.google.com/p/simple-build-tool/wiki/CustomActions
不过,基本上,您可能希望为每个添加一个新操作您的测试步骤,以获得您想要发生的特定事件。
You may want to look at this blog about using integrated testing with SBT and Hudson:
http://henkelmann.eu/2010/11/14/sbt_hudson_with_test_integration
Then, to add your own actions you can use this page:
http://code.google.com/p/simple-build-tool/wiki/CustomActions
Basically, though, you will probably want to add a new action for each of your testing steps, in order to get the particular events you want to happen.