I have some test to check my code. I have generated my report in sonarcloud but I have a problem: The coverage percentage takes into account also the test classes, that are obviously uncovered by other test. Is there any option just to take into account all the classes but the test ones??
How to exclude test classes form Coverage Analysis using Jacoco
1.2k views Asked by Jesús Navarro Hdez At
1
There are 1 answers
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in JACOCO
- Get control flow information with JaCoCo
- Jacoco Coverage in Multi-Module Gradle Project Not Including Submodules
- Java Code Coverage with both Jacoco & SonarQube
- Get program traces with JaCoCo
- Getting java.lang.IllegalArgumentException: MALFORMED in Jacoco plugin with Gradle 8.1
- Jacoco Pluggin not excluding classes , folder and files
- [email protected] Java 17 and sbt 1.9.8 and Scala 2.13 : report coverage is zero for all categories
- Unable to generate code coverage for integration test module using jacoco
- Execution data for class does not match in Jacoco when use the latest Sentry dependencies
- Gradle project JaCoCo plugin installation in offline mode is throwing error
- issues with Arcgic sdk being used with jacoco coverage report
- Jacoco Integration test report, getting error as Source file was not found during generation of report
- jacoco afterEvaluate doesn't exclude directories
- <module_name> Classes in bundle ' do not match with execution data. For report generation the same class files must be used as at runtime
- How to pass jvm arguments in a Jenkins build using Gradle 8.6?
Related Questions in SONARCLOUD
- how to analyse a project in sonarcloud
- Sonarcloud - Sonar warning - Accept button - "Valid issue but won't be fixed now, it's acceptable for a while."
- Unable to Publish Code Coverage Report into Sonar Cloud. Use of OpenCover.Console.exe and Vstest.console.exe
- Sonar warning S6857: Correct this malformed property placeholder - is this a false positive?
- How to get the exact Operator from SonarCloud for the Conditions in QualityGate?
- Sonarcloud giving uncovered lines for interface
- SonarCloud How to fix change this code to not construct the path from user-controlled data
- Sonar scan not the scanning project after java version updated from 11 to 17
- Sonarcloud code coverage for pull request with bitrise
- In azure Devops, Run on unit Test on Multi-Agent, how to collect the code coverage file and Publish into Artifact
- How to get weekly unit test coverage report in powerbi desktop from sonar cloud
- SonarCloud shows 0.0% coverage on new code, and it's 0.0% coverage on the project as well
- using sonarcloud for junit analysis fails when the source code version is jdk1.8 but sonarcloud uses jdk17
- Publishing Javascrpt/typescript code coverage to Sonarcloud not working with Azure Pipeline
- Azure Pipeline for SonarCloud analysis using Gradle is successful but no results are published
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
First of all i would not adapt Jacoco, but you can exclude files from coverage report within sonarqube/sonarcloud with the
sonar.coverage.exclusionsproperty, where you can eg. specify a pattern like**/*Test.javato exlude all java files ending withTest.Additionally you could also set this up within the UI, represented on the following screenshot:
Sidenote: i would inspect the sonar configuration, for me it looks like that test code is provided as normal sources to sonar. This would create such an topic, but normally sonar has an own property to configure test code. see analysis parameters documentation for further details or if you use gradle or maven plugins, check the respective documentation on how to organize the source code.