简体   繁体   English

具有持续集成的 HUnit/QuickCheck

[英]HUnit/QuickCheck with Continuous Integration

Are there any extensions to HUnit or QuickCheck that allow a continuous integration system like Bamboo to do detailed reporting of test results?是否有任何 HUnit 或 QuickCheck 扩展允许像Bamboo这样的持续集成系统对测试结果进行详细报告?

So far, my best idea is to simply trigger the tests as part of a build script, and rely on the tests to fail with a non-zero exit code.到目前为止,我最好的想法是简单地触发测试作为构建脚本的一部分,并依靠测试以非零退出代码失败。 This is effective for getting attention when a test fails, but confuses build failures with test failures and requires wading through console output to determine the problem's source.这对于在测试失败时引起注意是有效的,但会将构建失败与测试失败混淆,并且需要通过控制台 output 来确定问题的根源。

If this is the best option with current tools, my thought is to write a reporting module for HUnit that would produce output in the JUnit XML format , then point the CI tool at it as though it were reporting on a Java project. If this is the best option with current tools, my thought is to write a reporting module for HUnit that would produce output in the JUnit XML format , then point the CI tool at it as though it were reporting on a Java project. This seems somewhat hackish, though, so I'd appreciate your thoughts both on existing options and directions for new development.不过,这似乎有些骇人听闻,因此我很感谢您对现有选项和新开发方向的想法。

The test-framework package provides tools for integrating tests using different testing paradigms, including HUnit and QuickCheck, and its console test runner can be passed a flag that makes it produce JUnit-compatible XML.测试框架 package提供了使用不同测试范例(包括 HUnit 和 QuickCheck)集成测试的工具,并且它的控制台测试运行器可以通过一个标志,使其生成与 JUnit 兼容的 XML。 We use it with Jenkins for continuous integration.我们将它与 Jenkins 一起使用以进行持续集成。

Invocation example:调用示例:

$ ./test --jxml=test-results.xml

I've just released a package which generates test-suites based off modules containing quickCheck properties: http://hackage.haskell.org/package/tasty-integrate我刚刚发布了一个 package,它基于包含 quickCheck 属性的模块生成测试套件: http://hackage.haskell.org/package/tasty-

This is one step above test-framework/tasty at the moment, as it forcefully pulls/aggregates them off the filesystem, instead of relying upon per-file record keeping.目前,这是比 test-framework/tasty 高出一步,因为它强制将它们从文件系统中拉出/聚合,而不是依赖于每个文件的记录保存。 I hope this helps your CI process.我希望这对您的 CI 流程有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM