Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload coverage data as artifact? #26

Open
Thinkpiet opened this issue Dec 22, 2023 · 1 comment · May be fixed by #34
Open

Upload coverage data as artifact? #26

Thinkpiet opened this issue Dec 22, 2023 · 1 comment · May be fixed by #34
Labels
enhancement New feature or request

Comments

@Thinkpiet
Copy link
Member

Test code coverage data could be uploaded via actions/upload-artifact@v4.

Possible advantages:

  • we could create it for non-master branches (by manual trigger?)
  • we could create it in a separate workflow, independent of doxygen documentation generation
@Thinkpiet Thinkpiet added the enhancement New feature or request label Dec 22, 2023
@Thinkpiet Thinkpiet mentioned this issue Dec 22, 2023
@rubenhorn
Copy link
Contributor

rubenhorn commented Dec 22, 2023

Alternatively (or in addition), we could also use this action or this one on pull requests to monitor the test coverage of all files changed.
A simple script could calculate the coverage of functions in the modified files:

  1. Get all modified files
git diff --name-only $GITHUB_BASE_REF | grep -E '^[^(test)].*((\.h)|(\.cpph)|(\.cpp))$'
  1. Get all corresponding tests TN: SF: <full/source/file/path> ... end_of_record ... from the trace file build/coverage.info
  2. Get a list of all lines with functions in the corresponding file (All information should be contained in the trace file)
ctags -x --c-types=f <source/file/path> | grep function | awk '{print $3}'
  1. Compute the coverage only for the changed files (SF: <full/source/file/path>) based on the trace file, e.g. function coverage using FNDA: <execution count>,<function>. (s. FILES section in lcov documentation)

Alternatively, it might be much simpler just to extract this information from the HTML coverage report using Beautiful Soup.

@rubenhorn rubenhorn linked a pull request Jan 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants