This repository was archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Redesign of plugin using external coverage model #512
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New model files are now moved to metrics package. All required old model files have been duplicated to metrics package as well.
Codecov Report
@@ Coverage Diff @@
## master #512 +/- ##
============================================
- Coverage 72.83% 72.13% -0.71%
- Complexity 1031 1499 +468
============================================
Files 88 129 +41
Lines 3825 5810 +1985
Branches 440 605 +165
============================================
+ Hits 2786 4191 +1405
- Misses 892 1417 +525
- Partials 147 202 +55
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
# Conflicts: # plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageStatistics.java # plugin/src/main/java/io/jenkins/plugins/coverage/model/QualityGate.java # plugin/src/main/java/io/jenkins/plugins/coverage/model/QualityGateEvaluator.java # plugin/src/main/java/io/jenkins/plugins/coverage/model/QualityGateStatus.java # plugin/src/test/java/io/jenkins/plugins/coverage/model/QualityGateEvaluatorTest.java
- lines covered or not - partially covered lines - lines with survived mutations
Add Modified Files Coverage and Checks Publisher
# Conflicts: # plugin/pom.xml
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactoring of the recorder and step using the external Coverage Model.
Since we cannot make the new API (moving of the model classes to an external component, refactoring of the steps parameters, etc.) backward compatible, a new recorder (and step) has been added. The source code has been copied to the new
metricspackage so that old pipelines will still work out of the box. In order to use the new features, a new recorder needs to be used. The old code will be marked as deprecated and will not be supported anymore. It might get removed in a future version of this plugin.Coverage of delta changes
The plugin now computes and shows the absolute coverage of the project, the coverage of the modified files and the coverage of the modified lines so you can see how the changes actually affect the code coverage. Additionally, the delta of these coverages with respect to the reference build are computed.
Cyclomatic Complexity and LOC metrics
Several coverage parsers support the measurement of cyclomatic complexity and lines of code. These metrics are now computed and recorded as well:
Support for mutation coverage (PIT)
The new model has been extended so that not only code coverage but also mutation coverage can be evaluated and stored. That means that you can visualize JaCoCo code coverage results along with PIT mutation testing results. So a single code base and pipeline configuration can be used for these different report formats:
Display of all Metrics in tooltips
The coverage column and the build summary will show all available metrics in a tooltip.
Quality Gates
You can now specify an arbitrary number of quality gates that allow to set the build to unstable or failed if the thresholds are not met. For each quality gate the metric (branch coverage, complexity, etc.) and the baseline (whole project, changed files, etc.) can be defined.
Integrate new model into Checks report
The plugin continues to publish checks to supporting SCM platforms. Now the details of the checks report have been updated to be in sync with the details of the Jenkins build results.
Since the new model supports reporting of checks annotations as well, you will now see if lines or branches are missing in a pull request. Additionally, survived mutations are highlighted in a pull request as well.
Native step
The recorder has been extended with a native step that is capable of setting the step status (unstable, failed, ok).
Multiple invocations
You can invoke the new recorder step multiple times. For each call you can specify a different set of features. E.g., your database layer can use different quality gates than your business layer.
Fixes also the following issues:
Open tasks
Tasks for first beta:
Tasks for 4.0.0:
Tasks after 4.0.0: