[build] Add support for code coverage - #12259
Conversation
53d4f3f to
a1a58fa
Compare
|
What's the perf impact of running the coverage? Is it small enough to activate it for the 3rd party jobs (fiat-crypto etc)? |
I think it is around 2x / 3x time. |
|
@SkySkimmer certainly at every commit this could be too much, but we could run a weekly deeper coverage testing run indeed. |
Is this based on a measurement? I would not have expected the impact to be such, though I suppose it's plausible for very CPU-bound work. |
|
I'd be quite interested in seeing the code coverage diff between, say, all of the current CI vs all of the current CI + fiat-crypto-legacy (which I've been maintaining compatible with master for, even though it's been removed from the CI). If there's any diff, we might be able to extract some useful new test-cases. |
|
We would probably need to restore the old "combine expressions" for this (arithmetic/diffs on coverage output). If there is indeed interest in this, I can add them to Bisect_ppx. |
@aantron it is based on CI timings, bisect job: 73 mins, regular job ~ 40 mins. @JasonGross hopefully we do indeed start doing stuff like that once the setup is more stable. |
Ok. Just want to note: that difference would not be only from the instrumentation inserted into the code, but also due to the time taken to generate the report at the end. |
Indeed; I was maybe a bit pessimistic but also note that in the above job OCaml compilation time itself is a significant part so the current numbers are around a bit more than 2x ; Coq is likely worst case in this sense as some instrumented code paths are called dozens of millions of times as they are in critical loops [such as conversion] Would we tweak the instrumentation to leave out these hot paths, I'd bet the slowdown would be much less severe. |
|
@ejgallego The example artifact is long gone. Perhaps you could rerun the build for the PR so I can look at the output? I'd like to see how usable the output is for parser statistics as you suggested on the Coq call. I expect the 2x-3x overhead to run code coverage is far more expensive than generating the parser statistics in my PR, which should have a negligible effect on run time. |
|
Rebased in case someone wants to have a look. |
|
Does this need help from Bisect upstream? |
Thanks a lot @aantron , for now we are stuck on the coverage data upload (some problems with tokens in our CI setup) We are having a look, will let you know if we have feedback for upstream (maybe documenting our setup could be useful for others, so we may do a doc PR) |
|
The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed. |
|
This PR was not rebased after 30 days despite the warning, it is now closed. |
|
Reopened after the discussion in today's call, maybe we can debug / discuss what's missing here on Zulip? |
| - chmod +x codecov | ||
| - ./codecov -t ${CODECOV_TOKEN} -f coverage.json | ||
| # Bah bisect-ppx doesn't support gitlab CI | ||
| # - bisect-ppx-report send-to --source-path=_build/coverage --coverage-path=_build/coverage Codecov |
There was a problem hiding this comment.
Should this be uncommented to test?
There was a problem hiding this comment.
I think the line just above ./codecov .... should do the same trick, but I forgot about how the process looks like.
Maybe we should check if the bisect-ppx-report has support for gitlab CI already in the newer version.
There was a problem hiding this comment.
It looks like not https://github.com/aantron/bisect_ppx/blob/e30265643e77bcf2c9eba7322429c779122106fc/src/report/coveralls.ml#L148-L152
But it also shouldn't be too hard to add, it's just a matter of figuring out what variables live where. Or you can spoof it by setting variables appropriately
There was a problem hiding this comment.
@aantron is there any obstacle to supporting gitlab upstream?
There was a problem hiding this comment.
What about doing
| # - bisect-ppx-report send-to --source-path=_build/coverage --coverage-path=_build/coverage Codecov | |
| - bisect-ppx-report send-to --source-path=_build/coverage --coverage-path=_build/coverage Codecov --git --service-name="github" --service-pull-request="${CI_COMMIT_BRANCH#pr-}" --service-job-id="$CI_JOB_ID" | |
| - bisect-ppx-report send-to --source-path=_build/coverage --coverage-path=_build/coverage Coveralls --git --service-name="github" --service-pull-request="${CI_COMMIT_BRANCH#pr-}" --service-job-id="$CI_JOB_ID" |
?
|
Hi folks, a few points:
Unfortunately I have limited time to work on this in the upcoming weeks, but I'm happy to do my best to help if someone would like to try. |
I think we should, it would at least reduce rebase pain when working on the rest. |
|
@SkySkimmer I'll prepare a non-draft version ASAP. |
|
I see: |
Yes we need to enable the inria custom runners for docker-boot, it's a pain. |
|
in fact they're currently down |
|
Something I was thinking was about running coverage on Github actions, however that doesn't scale in the case we'd eventually like to run the coverage for the full CI. Another option is actually to run the full CI "offline", in one of our servers, and them push the reports to a static website. |
What is the issue? Presumably running coverage on the full CI could happen, say, on a schedule (once a week?) and when requested (like the bench), and there'd be no problem with using GitHub Actions then (other than having to duplicate everything in .gitlab.yml, which is maybe the lack of scaling you're talking about?) |
|
We now use the gitlab.inria.fr shared runners for docker-boot so if you rebase we may be able to get this merged |
|
Ok rebased, still not sure how to run the CI tho. |
|
|
||
| let decimal = | ||
| let ( || ) = parser_or in | ||
| let ( ||| ) = parser_or in |
There was a problem hiding this comment.
Bisect got confused with this overloading, I guess we should see if that's the case and submit a bug there (and remove this change)
This comment was marked as outdated.
This comment was marked as outdated.
|
@coqbot run light ci |
@ejgallego Do you need some extra setup somewhere? |
|
This failed due to the complexity tests... I cannot wait for the day these tests are removed from Coq, they only get in the way (pretty often in my case) |
|
The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed. |
|
The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed. |
|
This PR was not rebased after 30 days despite the warning, it is now closed. |
|
Is this something the Coq project wants? What is necessary from the Bisect side? aantron/bisect_ppx#436? |
Closes #10267
This PR went into a few iterations due to build system changes; it is in final form now. A couple of notes:
Integration with some coverage tool so we can actually see progress among releases, and extended weekly builds is desired, but not necessary to do here.