-
Notifications
You must be signed in to change notification settings - Fork 179
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
Build-over-build New Feature Proposal #80
Conversation
…an delta threshold values but overall coverage is better than last successful build's coverage
Hi..my pull request failed checks due to merge conflicts. I suppose only people with write access to the repository can resolve the conflicts. Any estimate when it will be done? Thanks. |
The conflicts mean that you developed the changes on an older version of the project. You can and should resolve the conflicts yourself by merging the latest changes from origin/master into your feature-branch and then pushing the merge-commit to Github, the PR will be updated with those changes automatically then. |
Ok. Thank you for clarifying. I will resolve the conflicts soon. |
Please review the PR. Thank you. |
@centic9 Hi. Can I get an estimated date for this PR merge and jacoco plugin next release? My team plans to use the next release for our project and we are seeking an estimation. Please let me know. Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed and verified the changes and it seems to work fine, a few questions/comments, though:
- Why did you need to change everything to BigDecimal? floats should have enough precision here, or?
- It is a bit uncommon to leave your name in all the code-places, the Git-history will show who did what anyway. It would be better to only describe why something was done to not clutter the code
Hi. I changed everything to BigDecimal for more accurate calculations of delta coverage. I agree with your second comment and have removed my name from the source code. Thanks. |
Hi. Can this PR be merged with the master branch if all the changes have been verified satisfactorily? I would also like to know about the next version release date. Please let me know. Thanks. |
Sorry for taking my time here, but I cannot rush here both because I want to really understand the reason for all the changes and also because I am only working on it in my free time, which is quite limited nowadays. Do you have an actual example where the precision of float was not enough? As we mostly operate in 0-100% with up to 2 decimal digits I don't immediately see the need here. What about using double? All the BigIntegers will introduce quite some more complexity and some memory overhead, I only want to introduce it if it is really necessary. Sorry for being picky, but this plugin is used by a lot of people and I don't want to introduce more complexity/overhead/memory than necessary without a good reason. |
I'm of course a friend of BigDecimals and promote them where ever possible. But I also don't get the reason why we might need them here? |
JacocoCoverageResultSummary currentBuildCoverage = JacocoLoadData.getResult(run); | ||
|
||
JacocoDeltaCoverageResultSummary jacocoDeltaCoverageResultSummary = new JacocoDeltaCoverageResultSummary(); | ||
jacocoDeltaCoverageResultSummary.instructionCoverage = lastBuildCoverage.getInstructionCoverage().subtract(currentBuildCoverage.getInstructionCoverage()).abs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks strange to me, why don't we keep the negative values so we know the actual difference?
With commits 2b0665e, 95983ae and de63db9 I have now applied/merged the changes, but reverted the BigDecimal changes for now. Please test the results as it was a non-primitive merge due to other concurrent changes in the meantime. I also adjust the handling of abs() somewhat, I hope it still works fine. Let me know as soon as you have verified the changes so we can prepare an official release. |
@centic9 My apologies for not been able to respond. My other tasks took higher priority. Thank you for reverting BigDecimal changes. I understand it was not a clever choice considering the performance issues it might cause. I am verifying the code from the master branch. |
no worries, I just released this as part of 2.2.0, please try that version directly via Jenkins update if possible so we get some more testing done early on and can release fixes quickly if necessary. |
Okay. That's great. I will test the released version then. I just have one question. can we also increase the scale of coverage percentages displayed on Jenkins job page? If yes, I can submit the change. It is important in case of millions of lines of code. |
I have tested the changes using 2.2.0 release version of the plugin from jenkins. It is working as expected. Also checked the source code. Thank you for including this feature and releasing it. It would be good if we display coverage % with increased scale (approx 6 digits after decimal). Can I add that change? |
Yes, sure, please create a new PR, but please try to make it an option with the current precision as default as many people don't care about having it in this detail-level, e.g. for me 78 or 79% is usually enough information as I have multiple smaller projects. |
Probably breaking the rules by posting here, but the mailing list looks dormant and I don't see a way to report an issue. I enabled the "Record JaCoCo coverage report" post-build task in my jenkins job and it worked great. I then clicked the "Fail the build if coverage degrades more than the delta thresholds" checkbox and ran the job again and got the following stack trace:
I'm using version 2.46.1 of jenkins and version 2.2.0 of the jacoco plugin. Thanks for your help. |
And...happily now there's #87 and https://issues.jenkins-ci.org/browse/JENKINS-43103. Thank you. |
Hi, I have a question/problem with this feature. I have this config in my pipeline:
But build not failing and finish successfully. Any idea how to break the build if delta thresholds check FAILS? Thanks! |
Yes, the items under "fail the build if " are probably what you are looking for. |
But what should be the ideal metrics which I need to give, as 2.0 for all or any other metrics, as 0 might fail, Could you suggest |
Can anyone explain me the scenario, as I kept delta threshold as 2.0, But for me the build was success in scenario-1 and failing in scenario-2. Scenario-1 02:16:01 [JaCoCo plugin] Delta coverage: class: 1.900177, method: 2.404953, line: 1.9257431, branch: 0.84700394, instruction: 0.9057579, complexity: 1.597332 Scenario -2 11:40:54 [JaCoCo plugin] Delta coverage: class: -1.900177, method: -2.404953, line: -1.9257431, branch: -0.84700394, instruction: -0.9057579, complexity: -1.597332 |
Build-over-build is a new feature proposed to eliminate Jenkin's builds with bad code coverage as compared to the last successful build. It allows user to configure delta threshold values for each type of coverage, which are compared to the delta coverage of the current build. Delta coverage of a build is defined as the absolute difference between coverage of last successful build and current build. If the coverage drops more than the user-configured thresholds then the build fails.
Build-over-build New Feature Proposal.pdf