-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Scoverage plugin, coverage check into CI #53
Conversation
Here are the highlights of this release: * Faster Kotlin DSL script compilation * Vendor selection for Java toolchains * Convenient execution of tasks in composite builds * Consistent dependency resolution
Also, in 7a91a29 we updated the most recent version. This brings some optimization, among which a faster Kotlin DSL script compilation, and do not "brokes" our code, so it's all good for us 📈 |
After various attempts, we managed to set up Scoverage into the project, disabling the parallel build feature (as does not give too many advantages to the build time). Now the ci workflows also check the coverage threshold after tests. Provisionally, the threshold is set to 0, but after finishing the test on CLI we should reach 75% coverage into cli and core. |
# Conflicts: # versions.properties
Kudos, SonarCloud Quality Gate passed! |
This PR is an attempt to solve part of the projects indicated in #52.
Following further researches, Jacoco is not an optimal solution for detecting the code coverage in Scala. Even though it gives you a coverage rate number, Jacoco knows nothing about Scala, and therefore it doesn’t tell you which piece of code you forgot to cover (as stated here).
An optimal solution could be using Scoverage, a tool thought explicitly for Scala code coverage analysis, a state-of-the-art technology for Scala projects. Anyway, we found that this tool presents a problem when used in multi-project parallel builds with Gradle 6.7+ (as our project is), therefore it could not be used at the moment.
Waiting for a better solution, we prepared a "patch" solution, including Jacoco support for the project, without embedding controls into the CI workflow. This way we can trigger a minimum of manual coverage control:
jacocoTestReport
task, to build and visualize human-readable text reports for the project;jacocoTestCoverageVerification
task, to check that the coverage is higher than a given coverage threshold. We have chosen a low threshold, on class coverage only (60% coverage), as with the mentioned above limitations, is a passable one, even if not very truthy.