AbsaOSS / login-service

AbsaOSS Common Login gateway using JWT Public key signatures
Apache License 2.0
2 stars 0 forks source link

#31 - Add code coverage support improve #32

Closed miroslavpojer closed 1 year ago

miroslavpojer commented 1 year ago

Closes #31

github-actions[bot] commented 1 year ago

JaCoCo code coverage report - scala:2.12.17

There is no coverage information present for the Files changed

Total Project Coverage 75.6% :green_apple:
miroslavpojer commented 1 year ago

All good. We will need to add classes with @Configuration to the excludes.

  • za.co.absa.logingw.rest.Application
  • za.co.absa.logingw.rest.SecurityConfig
  • za.co.absa.logingw.rest.WebMvcConfig

You will never be able to properly unit test these. These should be covered by Integration tests.

@miroslavpojer can I ask you to add them in this PR?

Sure, I can prepare excludes for them. Are Integration tests planned? In other projects these tests helps with code coverage.

Here is coverage of module service Absa fork JaCoCo 0.8.9 image Red: 100% coverage reported by JaCoCo

On next picture you can see that 2/3 of class files are already covered. Application.class is ignored by JaCoCo in default.

image

Intelli Jacoco (version not known) - See method column as closest similar metric image

Intellij in-build - See method column as closest similar metric image

Any from provided metric and tools do not show me which test covers it but on all reports it looks covered, so no excludes applied.

miroslavpojer commented 1 year ago

Interesting. Would this mean JaCoCo knows of Spring classes? Or is that just "luck"? I will look more into this.

JaCoCo can be a little bit unpredictable and most of expectations goes from real world practice. Basic answer is - if the class can be detected and instrumented by JaCoCo then it can be measured. I hope I will learn more about this process when I will trying to add method filtration feature into origin project.