Re: Code Coverage for C and Python

Charles R Harris via NumPy-Discussion <[email protected]> Fri, 13 Mar 2026 12:19:59 -0600
Newsgroups gmane.comp.python.numeric.general
Message-ID <CAB6mnx+4V6UuiuTxiHc2g1W6RWKrQL=DbwvpvHSkCORHsjBujQ@mail.gmail.com>
--===============8875015975020051933==
Content-Type: multipart/alternative; boundary="0000000000007ef9da064cebebe7"

--0000000000007ef9da064cebebe7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 11, 2026 at 6:20=E2=80=AFAM Ganesh Kathiresan via NumPy-Discuss=
ion <
[email protected]> wrote:

> Hi all,
>
> I wanted to get a wider feedback on adding a code coverage CI for C and
> Python. Prototype PR Link: https://github.com/numpy/numpy/pull/30911
>
> *Why add this CI:*
> - diff-cover provides a way to see coverage only on the changed files,
> which is good for big PRs to understand the UT compared to the main branc=
h.
> - With the new GH actions-upload (v7), we can get a clickable link to the
> report in a single file. For now the PR implements a MD file format as HT=
ML
> file leads to ~250MB file
>
> *Why not to add this CI:*
> - Today code coverage and dead code can be calculated locally by followin=
g
> this: https://numpy.org/doc/stable/dev/index.html#test-coverage. So there
> is not much value in running this for every PR
>
> Please let us know your thoughts on having this new CI action.
>
>
Code coverage fixes might be a good use case for AI. I'd rather see a tool
that could cover various things and be used to generate "problems" that
need to be solved. There are currently two tools in the `tools` directory,
I am not clear on how useful they are -- the C one uses valgrind -- but I'd
suggest something like a spin tool to generate code coverage reports
independently of CI.

Chuck

--0000000000007ef9da064cebebe7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g=
mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Mar 11,=
 2026 at 6:20=E2=80=AFAM Ganesh Kathiresan via NumPy-Discussion &lt;<a href=
=3D"mailto:[email protected]">[email protected]</a>&gt;=
 wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=
=3D"ltr"><div>Hi all,</div><div><br></div><div>I wanted to get a wider feed=
back on adding a code coverage CI for C and Python. Prototype PR Link:=C2=
=A0<a href=3D"https://github.com/numpy/numpy/pull/30911" target=3D"_blank">=
https://github.com/numpy/numpy/pull/30911</a></div><div><br></div><div><b>W=
hy add this CI:</b></div><div>- diff-cover provides a way to see coverage o=
nly on the changed files, which is good for big PRs to understand=C2=A0the =
UT compared to the main branch.</div><div>- With the new GH actions-upload =
(v7), we can get a clickable link to the report in a single file. For now t=
he PR implements=C2=A0a MD file format as HTML file leads to ~250MB file</d=
iv><div><br></div><div><b>Why not to add this CI:</b></div><div>- Today cod=
e coverage and dead code can be calculated locally by following this:=C2=A0=
<a href=3D"https://numpy.org/doc/stable/dev/index.html#test-coverage" targe=
t=3D"_blank">https://numpy.org/doc/stable/dev/index.html#test-coverage</a>.=
 So there is not much value in running this for every PR</div><div><br></di=
v><div>Please let us know your thoughts on having this new CI action.</div>=
<div><br></div></div></blockquote><div><br></div><div>Code coverage fixes m=
ight be a good use case for AI. I&#39;d rather see a tool that could cover =
various things and be used to generate &quot;problems&quot; that need to be=
 solved. There are currently two tools in the `tools` directory, I am not c=
lear on how useful they are -- the C one uses valgrind -- but I&#39;d sugge=
st something like a spin tool to generate code coverage reports independent=
ly of CI.</div><div><br></div><div>Chuck=C2=A0</div></div></div>

--0000000000007ef9da064cebebe7--

--===============8875015975020051933==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/numpy-discussion.python.org
Member address: [email protected]

--===============8875015975020051933==--