code-coverage

Getting jacoco report from cucumber tests with gradle

天涯浪子 提交于 2020-04-30 07:47:48
问题 I am working with gradle in a java project, I run my cucumber tests with a gradle task, something like this: task cucumber (){ //task that starts the app dependsOn 'jettyRunDaemon' jvmArgs '-javaagent:E:/MyProject/build/jacoco/jacocoagent.jar=destfile=build/jacoco/jacoco.cucumber.exec' doLast { javaexec { main = 'cucumber.api.cli.Main' classpath = sourceSets.main.output + sourceSets.test.output + configurations.testRuntime args = cucumberArgs() } } } List<String> cucumberArgs() { def args = [

Getting jacoco report from cucumber tests with gradle

无人久伴 提交于 2020-04-30 07:46:50
问题 I am working with gradle in a java project, I run my cucumber tests with a gradle task, something like this: task cucumber (){ //task that starts the app dependsOn 'jettyRunDaemon' jvmArgs '-javaagent:E:/MyProject/build/jacoco/jacocoagent.jar=destfile=build/jacoco/jacoco.cucumber.exec' doLast { javaexec { main = 'cucumber.api.cli.Main' classpath = sourceSets.main.output + sourceSets.test.output + configurations.testRuntime args = cucumberArgs() } } } List<String> cucumberArgs() { def args = [

Getting jacoco report from cucumber tests with gradle

╄→尐↘猪︶ㄣ 提交于 2020-04-30 07:45:07
问题 I am working with gradle in a java project, I run my cucumber tests with a gradle task, something like this: task cucumber (){ //task that starts the app dependsOn 'jettyRunDaemon' jvmArgs '-javaagent:E:/MyProject/build/jacoco/jacocoagent.jar=destfile=build/jacoco/jacoco.cucumber.exec' doLast { javaexec { main = 'cucumber.api.cli.Main' classpath = sourceSets.main.output + sourceSets.test.output + configurations.testRuntime args = cucumberArgs() } } } List<String> cucumberArgs() { def args = [

How to exclude spec files while getting code coverage [Angular]

强颜欢笑 提交于 2020-04-30 06:25:43
问题 I'm trying to get the code coverage of my angular project. I'm not very well versed with the tools. I decided to use "istanbul-instrumenter-loader": "^3.0.1" . I tried taking help from this question: angular cli exclude files/directory for ng test--code-coverage and Regex that doesn't match spec.ts and spec.tsx but should match any other .ts and .tsx And many other solutions given on the same thread. My problem is that I want to exclude spec files which I wrote for unit testing. Here is the

Can you use Coverlet to get code coverage data in a .NET Framework project?

匆匆过客 提交于 2020-04-18 06:11:28
问题 I have a large .NET Framework solution and want to start collecting code coverage data as part of our build pipeline (as well as on our local developer machines). On the Coverlet GitHub page it says that it supports .NET Framework projects but all the examples are using the dotnet test CLI command. Is it possible to use Coverlet for this or should I be looking at something like OpenCover? 回答1: Use the task Visual Studio Test Create a .runsettings file and configure Coverlet in the

Can you use Coverlet to get code coverage data in a .NET Framework project?

三世轮回 提交于 2020-04-18 06:11:09
问题 I have a large .NET Framework solution and want to start collecting code coverage data as part of our build pipeline (as well as on our local developer machines). On the Coverlet GitHub page it says that it supports .NET Framework projects but all the examples are using the dotnet test CLI command. Is it possible to use Coverlet for this or should I be looking at something like OpenCover? 回答1: Use the task Visual Studio Test Create a .runsettings file and configure Coverlet in the

SonarQube + Maven + JaCoCo + GitLab CI: Sonar started to show 0% code coverage after upgrading to SonarQube 7.9.2

无人久伴 提交于 2020-04-17 22:07:46
问题 After we upgraded our SonarQube to Version 7.9.2 (build 30863), Community Edition , running the GitLab CI Pipeline results in showing 0.0% coverage (dropping from about 86.2% ), although Sonar is showing all unit tests. Maven build executed in .gitlab-ci.yml looks like this: - mvn test sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_TOKEN} Obviosuly this has something to deal with notorious sonar.coverage.jacoco.xmlReportPaths and sonar.jacoco.reportPaths Sonar-JaCoCo

SonarQube + Maven + JaCoCo + GitLab CI: Sonar started to show 0% code coverage after upgrading to SonarQube 7.9.2

无人久伴 提交于 2020-04-17 22:05:53
问题 After we upgraded our SonarQube to Version 7.9.2 (build 30863), Community Edition , running the GitLab CI Pipeline results in showing 0.0% coverage (dropping from about 86.2% ), although Sonar is showing all unit tests. Maven build executed in .gitlab-ci.yml looks like this: - mvn test sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_TOKEN} Obviosuly this has something to deal with notorious sonar.coverage.jacoco.xmlReportPaths and sonar.jacoco.reportPaths Sonar-JaCoCo

Jacoco code coverage dropped with migration to Java 11

青春壹個敷衍的年華 提交于 2020-04-16 15:02:09
问题 I have several Gradle projects that were built using Java 8, and after converting them recently to use Java 11, Jacoco code coverage reports have been reporting much lower percentages than before. On one project, immediately after the transition, my coverage dropped from 81% to 16%. I tried updating the Jacoco plugin to 0.8.3 (which has official JDK 11 support), Gradle to 5.4, and TestNG to 6.14.3 (not sure if this has any effect; thought it couldn't hurt to be on the latest version). Even

Using omit flag in Python coverage.py API

三世轮回 提交于 2020-04-12 18:53:07
问题 I'm using the python coverage.py to create a very basic test suite with coverage. Currently everything works great. However, my coverage report includes all the /usr/local/lib libraries that are called and all the __init__.py files. Here's what my coverage report call looks like right now: self.cov.html_report(directory='coverage', omit='*Test*, */usr/local/lib*,*__init__*') The goal is to use the omit flag to remove all classes with the word "Test", "/usr/local/lib", or "__init__" in them.