Java Test Coverage Using JaCoCo

Поделиться
HTML-код
  • Опубликовано: 11 янв 2025

Комментарии • 9

  • @drakezen
    @drakezen 3 года назад +2

    Definitely would be good to have more videos on testing in general, such as automated api testing run from a test container controlled by a Jenkins pipeline

  • @edgarcostamelo8275
    @edgarcostamelo8275 3 года назад +2

    congratulations for the video, very good.
    I have a question, could you answer me how to show in the report only the classes that are being covered by the tests?
    Thank you very much in advance

    • @TechTutorRyan
      @TechTutorRyan  3 года назад

      I am not sure if I understand the question. JaCoCo will automatically check each class for missed instructions or missed branches. However, in the video I do show how you can exclude specific classes from being tested by JaCoCo.

    • @edgarcostamelo8275
      @edgarcostamelo8275 3 года назад

      ​@@TechTutorRyan Thanks for the feedback
      I need the report to only show a green bar. Dare to show only what is being covered and disregard what is not covered. I need it to show at runtime as JACOCO compiles the tests

  • @bobbirahmirres3638
    @bobbirahmirres3638 3 года назад +1

    Great video! 👍

  • @okerror1451
    @okerror1451 2 года назад

    I wonder if it's a good idea to fail a build just because the coverage gets below a certain ratio. Let's say you have an urgent fix, and there isn't time to write a unit test to get from 89.5% to 90.1% -- I think it's good to have a threshold, but it ought to be non-blocking.

    • @TechTutorRyan
      @TechTutorRyan  2 года назад

      If you have that is bordering 90% at all times, then you may be cutting corners. Also, you may decide 80% is sufficient as well, but if you write new code that is for an urgent fix, there is no reason you can't add a test to ensure that fix stays in place as well.