Skip to content

Support test coverage - #366

Open
Sichao25 wants to merge 1 commit into
SCOREC:developfrom
Sichao25:yus/ci
Open

Support test coverage#366
Sichao25 wants to merge 1 commit into
SCOREC:developfrom
Sichao25:yus/ci

Conversation

@Sichao25

Copy link
Copy Markdown
Contributor

No description provided.

@Sichao25

Copy link
Copy Markdown
Contributor Author

We may need to combine pytest-cov and gcov. I will go back on this later.

@Sichao25

Copy link
Copy Markdown
Contributor Author

I get the following summary for the C++ code coverage:

lines:     74.1% (13809 out of 18632)
functions: 74.6% (1588 out of 2128)
branches:  38.8% (14631 out of 37663)

My understanding is that gcovr generates a coverage file containing more detailed information, which we can investigate after uploading or printing. However, the upload step is currently guarded for forked repositories for security (followed the example here):

if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && matrix.python_api == 'ON'

It seems that there is no way to verify the uploaded coverage details until we actually trigger the upload step. Alternatively, we could remove this upload step and just print the contents of the output file directly in the CI log with something like cat coverage-cpp.txt.

I would assume that uploading the coverage report is the more standard and visible approach, but I’m also fine with printing it in the CI log if there are different opinions.

@Sichao25
Sichao25 marked this pull request as ready for review August 26, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant