mufasa1976 commented on PR #315: URL: https://github.com/apache/commons-fileupload/pull/315#issuecomment-2121014072
> > I've fixed the Checkstyle Bugs. But now I got a failure from Jacoco. > > ``` > > [WARNING] Rule violated for bundle commons-fileupload2-core: lines covered ratio is 0.41, but expected minimum is 0.42 > > ``` > > > > > > > > > > > > > > > > > > > > > > > > The Problem is that I added a Test for the `FileItemInputIteratorImpl` and `AbstractFileUpload` but these will not be execute by the module `commons-fileupload2-core`. Indeed the changed Lines will be covered by Tests of all other Modules because these will extend `AbstractFileUploadTest` located within the Module `commons-fileupload2-core`. > > But this "Warning" will cause that the Code Coverage of the Module `commons-fileupload2-core` sinks beyound 0.42 (indeed it is now 0.41). Should I set the Value of the Code-Coverage to 0.41 within `commons-fileupload2-core/pom.xml`? > > > Author > > The point of the Jacoco check is to avoid making things worse and, conversely, to improve the overall quality of the component. So I encourage you to improve the state of the code. > > Run: `mvn clean site` (or `mvn clean site -P jacoco`) and look at the Jacoco report in `target/site` where you'll see a nice HTML report with code highlights of what's tested and what's not. This will let you make sure that the code you touch in a PR is indeed touched by tests, new or existing. It's not perfect, but we want to quality overall, to grow, not shrink ;-) I've ran `mvn clean site` (and also `mvn clean site -P jacoco`) but unfortunatly the Jacoco-Report of `commons-fileupload2-core` shows that **NO** Lines of `AbstractFileUpload` or `FileItemInputIteratorImpl` will be covered. It seems that Jacoco doesn't take care of Project-internal Dependencies because `common-fileupload2-core` has been added as a compile Dependency to `common-fileupload2-servlet5`, `common-fileupload2-servlet6`, `common-fileupload2-javax` and `common-fileupload2-portlet`. I've made a Code Coverage Run with IntelliJ on the Modules `common-fileupload2-servlet5`, `common-fileupload2-servlet6`, `common-fileupload2-javax` and `common-fileupload2-portlet` and I have seen that my Code will be covered by the Test I've written. So unless there is a Chance to tell Jacoco to take some Dependencies in Content the only solution I see is to reduce the Line Complexity on `common-fileupload2-core` because some of these Classes (i.E. `AbstractFileUpload` or `FileItemInputIteratorImpl`) can't be covered by Tests on `common-fileupload2-core` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
