Using JaCoCo to measure system test coverage

Поділитися
Вставка
  • Опубліковано 29 сер 2024

КОМЕНТАРІ • 17

  • @simopr09
    @simopr09 2 роки тому +2

    Hallo Sebatian! Just a hi from a developer! Thanks for your great videos! They are specialized videos

  • @TenryuL
    @TenryuL 4 місяці тому +1

    This really helped me out, Thanks a lot!

  • @tobiasnickel3750
    @tobiasnickel3750 2 роки тому +1

    thanks, it was very important to understand the use of the agent. even dough I am not using maven but the java command directly, your video really helped me. Thanks

  • @sarveshpatil6210
    @sarveshpatil6210 Місяць тому

    Hi Sebastian, Thank you for for this great video. I have integrated this with CICD and it generates the jacoco report as expected but it doesn't give line by line code coverage the way you have shown.
    It says .jar file not found, do we need to pass anything extra when integrated with CICD?

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  Місяць тому

      No, not more than what I'm showing in the video. I'd debug the same commands that you run in your CI/CD locally and see what it yields you. There's usually also a way to debug your CI/CD server and run commands step-by-step and observe the result...

  • @onkarmundaye2647
    @onkarmundaye2647 Рік тому

    Hi Sebastin, This is really good. But what if those UI Automation tests are written somewhere else and not coupled with your java-application? How you could calculate how much code coverage it is doing with UI-Automation for any microservice app?

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  Рік тому +1

      Same story, you don't need a connection to the test project, it could even be written in a different technology. This does indeed work for any acceptence/system/UI/external tests.

  • @saanvimendiratta8462
    @saanvimendiratta8462 2 роки тому

    Can you please share one example with gradle also

  • @ChaiSuttaClips
    @ChaiSuttaClips Рік тому

    How you have created jar of the web application, Could yuo please help or share git link of quarkus code and jar

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  Рік тому

      The process is described here: blog.sebastian-daschner.com/entries/jacoco-system-test-coverage and you can find the project here: github.com/sdaschner/coffee-testing (incl. description how to build it)

  • @sarveshpatil6210
    @sarveshpatil6210 25 днів тому

    Great video it was very helpful, I just wanted to see how can we exclude few classes and methods which we don’t want to be the part of the jacoco report.
    I tried excludes=/com/abc/xyz/class but somehow it still shows the output in result

  • @roopeshraju9723
    @roopeshraju9723 Рік тому

    Hello
    Sebastian Daschner I notice that Jacoco.exec file is not getting created kindly help

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  Рік тому

      Hi, try to follow the example with the code linked here: blog.sebastian-daschner.com/entries/jacoco-system-test-coverage
      When you run the app with the agent, it should create the .exec file in the same directory. Then you can run the Maven plugin for the report.

  • @prasantkumarsamantaray3130
    @prasantkumarsamantaray3130 Рік тому

    Hi,
    Need one help!
    How can i integrate with ci cd?

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  Рік тому

      In this case you likely want a dedicated system test environment where you can add the agent in the same way as you run the Java app (e.g. in Docker, etc.), then you can grab the created *.exec file afterwards. You'll likely want to integrate a process that redeploys and controls that extra deployment step before and afterwards. I.e.: 1) Deploy to ST env with jacoco agent 2) wait for running app 3) run all system tests 4) take *.exec and (optionally) tear down

  • @premanandmuthiah2629
    @premanandmuthiah2629 Рік тому

    everything worked but i could not see the coverage in the report. any reason. started java -javaagent:/.m2/repository/org/jacoco/org.jacoco.agent/0.8.7/org.jacoco.agent-0.8.7-runtime.jar -jar target/demo-1.0-SNAPSHOT.jar then executed some curl script then mvn \
    org.jacoco:jacoco-maven-plugin:0.8.7:report \
    -Djacoco.dataFile=target/jacoco.exec then opened the index.html from site. it has red color only in the coverage report