简体   繁体   English

sbt单元和集成测试的聚合覆盖率报告

[英]sbt aggregate coverage reports for unit and integration tests

I use the sbt plugin scoverage to generate test coverage reports for my scala project. 我使用sbt插件scoverage为我的scala项目生成测试覆盖率报告。 However, I'm unable to combine the test reports for unit tests and integration tests. 但是,我无法将测试报告与单元测试和集成测试结合起来。

Here are the commands I run 这是我运行的命令

sbt coverage test // to run unit tests
sbt coverage it:test // to run integration tests
sbt coverageReport // to generate coverage report

In the case above, I only get the coverage report for integration tests. 在上面的例子中,我只获得了集成测试的覆盖率报告。

Question

  • How do I generate a report that aggregates results from both the unit tests as well as the integration tests? 如何生成汇总单元测试和集成测试结果的报告?

Thanks in advance. 提前致谢。

The issue was that I was running sbt clean after running the unit tests and before running the integration tests. 问题是我在运行单元测试之后和运行集成测试之前运行sbt clean

So, the commands as listed above, should generate the combined coverage report. 因此,上面列出的命令应生成组合覆盖率报告。

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

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