<div dir="ltr"><div>I've made some progress. If I'm not mistaken, Hackage is running the tests with coverage enabled [1], it's then running hpc to analyze program coverage [2], that's being included in the report [3-5].<br></div><div><br><div>I think it would be very useful for package maintainers and devs to be able to replicate what the hackage server does in a docker image, not just for coverage, but for everything. One of my packages is showing that the tests fail [6]; I suspect it's due to a bug in cabal [7], but the report on hackage does not help me understand what went wrong.<br><div><br></div><div>Ivan</div><div><br></div><div>[1]  <a href="https://github.com/haskell/hackage-server/blob/b4ea1c73ba85f24985259fd1df4664747ceb0159/exes/BuildClient.hs#L641" target="_blank">https://github.com/haskell/hackage-server/blob/b4ea1c73ba85f24985259fd1df4664747ceb0159/exes/BuildClient.hs#L641</a><br>[2] <a href="https://github.com/haskell/hackage-server/blob/b4ea1c73ba85f24985259fd1df4664747ceb0159/exes/BuildClient.hs#L613-L630" target="_blank">https://github.com/haskell/hackage-server/blob/b4ea1c73ba85f24985259fd1df4664747ceb0159/exes/BuildClient.hs#L613-L630</a></div>[3] <a href="https://github.com/haskell/hackage-server/blob/b4ea1c73ba85f24985259fd1df4664747ceb0159/exes/BuildClient.hs#L576" target="_blank">https://github.com/haskell/hackage-server/blob/b4ea1c73ba85f24985259fd1df4664747ceb0159/exes/BuildClient.hs#L576</a></div><div>[4] <a href="https://github.com/haskell/hackage-server/blob/b4ea1c73ba85f24985259fd1df4664747ceb0159/src/Distribution/Server/Features/BuildReports/BuildReport.hs#L277-L295" target="_blank">https://github.com/haskell/hackage-server/blob/b4ea1c73ba85f24985259fd1df4664747ceb0159/src/Distribution/Server/Features/BuildReports/BuildReport.hs#L277-L295</a></div><div>[5] <a href="https://github.com/haskell/hackage-server/blob/9637bd45ba8c321bb9a938c47a15c014dc8bdd88/src/Distribution/Server/Features/BuildReports.hs#L344-L345" target="_blank">https://github.com/haskell/hackage-server/blob/9637bd45ba8c321bb9a938c47a15c014dc8bdd88/src/Distribution/Server/Features/BuildReports.hs#L344-L345</a></div><div>[6] <a href="https://hackage.haskell.org/package/copilot-core-3.9" target="_blank">https://hackage.haskell.org/package/copilot-core-3.9</a></div><div>[7] <a href="https://github.com/haskell/cabal/issues/6440" target="_blank">https://github.com/haskell/cabal/issues/6440</a></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 7 May 2022 at 15:15, Ivan Perez <<a href="mailto:ivanperezdominguez@gmail.com" target="_blank">ivanperezdominguez@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Mikolaj</div><div><br></div><div>For an example, see the badges at:</div><div><a href="https://hackage.haskell.org/package/bytestring/" target="_blank">https://hackage.haskell.org/package/bytestring/</a></div><div><br></div><div>And the info at:<br></div><div><a href="https://hackage.haskell.org/package/bytestring-0.11.3.1/reports/1" target="_blank">https://hackage.haskell.org/package/bytestring-0.11.3.1/reports/1</a><br><br></div><div>As Tikhon says, the badges are not part of the README. They are inserted by hackage.<br></div><div><br></div><div>Ivan<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 7 May 2022 at 14:56, Tikhon Jelvis <<a href="mailto:tikhon@jelv.is" target="_blank">tikhon@jelv.is</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Looks like it's built into Hackage and not just in the Readme. The bytestring package is a good example with several badges including code coverage; if you click the "Build | InstallOK" badge, you get a more detailed report.</div><div><br></div><div><a href="https://hackage.haskell.org/package/bytestring" target="_blank">https://hackage.haskell.org/package/bytestring</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 7, 2022 at 11:46 AM Mikolaj Konarski <<a href="mailto:mikolaj@well-typed.com" target="_blank">mikolaj@well-typed.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Ivan,</div><div><br></div><div>Was that icon just a part of a README? If not, could you <br></div><div>give a link?</div><div><br></div><div>In any case, people at the #hackage Matrix/IRC channel may <br></div><div>know about any plans to add that (#hackage is a shared room <br></div><div>for Hackage and related topics such as ghcup, cabal, <br></div><div>Stackage-Hackage interoperation, etc.; all are welcome).</div><div><br></div><div>Cheers,</div><div>Mikolaj<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 7, 2022 at 7:31 PM Ivan Perez <<a href="mailto:ivanperezdominguez@gmail.com" target="_blank">ivanperezdominguez@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>What analysis does the hackage server run to determine the coverage level of, or rating given to, a particular package?</div><div><br></div><div>For example, for one package it is showing this icon:</div><div><br></div><div><a href="https://img.shields.io/static/v1?label=Coverage&message=32%&color=red" target="_blank">https://img.shields.io/static/v1?label=Coverage&message=32%&color=red</a></div><div><br></div><div>What does that actually mean? The build log states:</div><div><h3>Code Coverage</h3>

  <table>
    <tbody><tr><th colspan="2">expressions</th><td>32% (224/684)</td></tr>
    <tr><th colspan="1" rowspan="3">boolean</th><th>guards</th><td>100% (0/0)    </td></tr>
    <tr><th>conditions</th><td> 20% (1/5) </td></tr>
    <tr><th>qualifiers</th><td>100% (0/0)</td></tr>
    <tr><th colspan="2">alternatives</th><td>27% (5/18)</td></tr>
    <tr><th colspan="2">local declarations</th><td>40% (6/15)</td></tr>
    <tr><th colspan="2">top-level declarations</th><td>32% (29/90)</td></tr></tbody></table></div><div><br></div><div>Is it possible to see details of how hackage is arriving to these conclusion, and to replicate these results locally?<br></div><div><br></div><div>Thanks,</div><div><br></div><div>Ivan<br></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>
</blockquote></div>
</blockquote></div>