t8code icon indicating copy to clipboard operation
t8code copied to clipboard

Feature: Generate Code Coverage report

Open lenaploetzke opened this issue 10 months ago • 1 comments

Describe your changes here: Closes #110

All these boxes must be checked by the AUTHOR before requesting review:

  • [ ] The PR is small enough to be reviewed easily. If not, consider splitting up the changes in multiple PRs.
  • [ ] The title starts with one of the following prefixes: Documentation:, Bugfix:, Feature:, Improvement: or Other:.
  • [ ] If the PR is related to an issue, make sure to link it.
  • [ ] The author made sure that, as a reviewer, he/she would check all boxes below.

All these boxes must be checked by the REVIEWERS before merging the pull request:

As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.

General

  • [ ] The reviewer executed the new code features at least once and checked the results manually.
  • [ ] The code follows the t8code coding guidelines.
  • [ ] New source/header files are properly added to the CMake files.
  • [ ] The code is well documented. In particular, all function declarations, structs/classes and their members have a proper doxygen documentation.
  • [ ] All new algorithms and data structures are sufficiently optimal in terms of memory and runtime (If this should be merged, but there is still potential for optimization, create a new issue).

Tests

  • [ ] The code is covered in an existing or new test case using Google Test.

If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):

  • [ ] Should this use case be added to the github action?
  • [ ] If not, does the specific use case compile and all tests pass (check manually).

Scripts and Wiki

  • [ ] If a new directory with source files is added, it must be covered by the script/find_all_source_files.scp to check the indentation of these files.
  • [ ] If this PR introduces a new feature, it must be covered in an example or tutorial and a Wiki article.

License

  • [ ] The author added a BSD statement to doc/ (or already has one).

lenaploetzke avatar Apr 08 '25 11:04 lenaploetzke

Welcome to Codecov :tada:

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered :open_umbrella:

codecov[bot] avatar Apr 09 '25 11:04 codecov[bot]

I am waiting for a manual run to finish, but already give you the review comments.

holke avatar May 13 '25 09:05 holke

Thank you for your review. :) I had the following problem, which is why I introduced the macro T8_CODE_COVERAGE: With test level 2 the coverage was (as expected) a bit lower than with level 0 because some code is not executed (especially some if conditions). With test level 2, however, the collection of coverage information takes too long for the ci (because we can only use 4 jobs there). Accordingly, we now use test level 1 in the ci and test a little more by using T8_CODE_COVERAGE to get the same code coverage results as with level 0. Do you maybe have a better idea to avoid the problems?

lenaploetzke avatar May 13 '25 10:05 lenaploetzke

The corresponding Wiki article is now available under https://github.com/DLR-AMR/t8code/wiki/Generating-a-code-coverage-report. (But not yet linked in the sidebar to avoid confusion)

lenaploetzke avatar May 14 '25 14:05 lenaploetzke