Skip to content

Prepare a coverage report in the CI#2299

Merged
scarlehoff merged 3 commits intomasterfrom
coverage_report
Mar 17, 2025
Merged

Prepare a coverage report in the CI#2299
scarlehoff merged 3 commits intomasterfrom
coverage_report

Conversation

@scarlehoff
Copy link
Member

@scarlehoff scarlehoff commented Mar 11, 2025

This closes #29 :)

At the moment the coverage report is not uploaded and not enforced just shown in the CI.

We have currently 69% coverage (nice! since it is "organic"!)

I'm not sure whether some tests started by subprocesses are counted correctly (apparently is is quite difficult to do so, but pytest-cov includes some tricks).

@scarlehoff scarlehoff added the devtools Build, automation and workflow label Mar 11, 2025
@scarlehoff scarlehoff linked an issue Mar 11, 2025 that may be closed by this pull request
@scarlehoff scarlehoff marked this pull request as draft March 12, 2025 09:32
@scarlehoff scarlehoff requested a review from comane March 12, 2025 11:00
@scarlehoff scarlehoff marked this pull request as ready for review March 12, 2025 11:02
@RoyStegeman
Copy link
Member

Can also be used to identify dead code? I.e. if a function is not being tested that could be a good indicator that it's not used anymore. Is it possible outputting a list of the functions that are not covered rather than just the percentage per file?

@scarlehoff
Copy link
Member Author

Yes. Not sure if in terms of functions but you can also have a look at the report in terms of lines being skipped. For some files there are big chunks which are currently untested.

@RoyStegeman
Copy link
Member

RoyStegeman commented Mar 13, 2025

Yes. Not sure if in terms of functions but you can also have a look at the report in terms of lines being skipped. For some files there are big chunks which are currently untested.

That doesn't surprise me too much, but I'm curious to find out how much of the untested code hasn't been used in years anyway

@scarlehoff
Copy link
Member Author

That's more difficult to know, for instance the closure tests have some files that are around 20% covered, but there's a lot of stuff going on in closure-test-land for which we have no tests.

Base automatically changed from merge_workflows to master March 14, 2025 12:09
@comane
Copy link
Member

comane commented Mar 15, 2025

At the moment the coverage report is not uploaded and not enforced just shown in the CI.

Perhaps it would be better to have a test badge that shows the coverage rather than having it only in the CI?

@scarlehoff
Copy link
Member Author

I think it'd be nice, but when I was preparing the workflow the alternatives I could find were either autocommit at the end (big no!) or use codecov (which seems to be a security nightmare just for a badge).

If you know of some alternative where one can just upload the report and get coverage without bells and whistles I'd be happy to add it.

(there is a third option, use our own server for that, in another moment I would be happy to set up and maintain that but right now I'd rather not)

@RoyStegeman
Copy link
Member

I'd be very surprised of the people looking at our code at a surface level (i.e. not even opening a ci report) care about codecov

@scarlehoff scarlehoff merged commit e58ec5c into master Mar 17, 2025
11 checks passed
@scarlehoff scarlehoff deleted the coverage_report branch March 17, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devtools Build, automation and workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate coverage reports

3 participants