-
-
Notifications
You must be signed in to change notification settings - Fork 648
[WIP] Enable coverage statistics #5990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Seems like the factor is ~1.5-2x of the build time for the two jobs. On the other hand the current documentation says that a job is killed if it "takes longer than 50 minutes on travis-ci.org", so it seems like they silently increased the timeout limit as the builds are still passing. |
What goes into the dmd coverage? Compiling the test suite, compiling Phobos, or both? Also, while this is great, I'm concerned about slowing down the autotester 2x. |
Both.
Yes I do know :/ |
My suggestion would be to only run the coverage once per day on master. |
Well we want to know the effect of a PR on the total coverage, so that won't work, but as stated before I think using another free CI dedicated to compile the coverage statistics seems like a good solution to me. |
Just pushing on work on another service is hardly fair. Another suggestion would be to use a magic word such as |
We can just have the auto-tester report the results, because it already runs all the tests… Oh wait. |
Current coverage is 87.59% (diff: 50.00%)
|
|
Yes but without coverage statistics which is a bit time consuming - on Travis it doubled the build time (second and fourth build):
The idea of automation is that you get warned automatically if a new PR introduces lines which are never tested.
Fair enough, I assume the same applies for Druntime?
That's the default behavior for Github ;-)
Merge commits have a different commit hash and diff, so I don't know how we could teach CodeCov that. Imho this optimization isn't worth it, because a full build on e.g. CircleCi takes 20 minutes & there are about 3 merges per day.
Adding the setup for CircleCi wasn't that difficult and it takes less then 20 minutes for both 32-bit and 64-bit coverage builds to pass (they are run in parallel). Imho that's the best way to move forward as it doesn't strain our burdened resources or has any other negative impact (=it doesn't affect the other builds and if it crashes we only lack coverage info for pending PRs). @WalterBright what do you think? Worth the experiment? |
Yes.
I thought dmd runs were done by the autotester if any Phobos merges happen. What about item (4)? I found this on CircleCI: https://circleci.com/pricing/ I suppose as long as they offer 1 free container, might as well take advantage of it. So merging this won't slow down the autotester? |
Note that because the back end doesn't have a fully open-source license, we can only use one container free on CircleCI. |
Yes, but all other CI providers just listen to the push events of a PR and consequently put a build into their job queue.
Sorry skipped over it. So you refer to merge commits added to the PR or rebases? A forced rebase deletes the previous commit hash and diff, merge commits might be able to be detected.
I think they have a similar literal definition of open source as Travis CI that goes like "everything that is publicly available on Github". Paid plans are for private repos.
(If this change is error-free), AutoTester shouldn't know about it. Coverage is only run if the FYI I just removed the changes from the |
Could you ask them for clarification that that is their definition, please? |
Why would we start to use another CI provider if we have to run the test suite there again? Doesn't save any resources. |
version (Windows) | ||
enum sourcePath = dirName(__FILE_FULL_PATH__, `\`); | ||
else | ||
enum sourcePath = dirName(__FILE_FULL_PATH__, '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary? Couldn't you just run the script that parses the coverage results from the src folder so that the relative paths work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't you just run the script that parses the coverage results from the src folder so that the relative paths work.
Well the script just runs the normal test_runner without modifications, the only change is that dmd
has been compiled with -cov
.
I am not very familiar with the dmd setup, so if you have better ideas, shoot! ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not about the test runner, but about the resulting coverage files (*.lst
). Wouldn't it work if you upload them after changing into the src folder? That folder is our compilation root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am not mistaken, If Druntime can't find the source files, it will just produce empty .lst
files.
Wouldn't it work if you upload them after changing into the src folder?
It turns out that we don't need to set the dest
directory, because the issue was on CodeCov's side and one can manually set mapping patterns.
(the dest
directory change is a later follow-up)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am not mistaken, If Druntime can't find the source files, it will just produce empty .lst files.
Yes, sounds true.
Yep done, might take a while until we hear back from. I guess until then we can use the 1 container which is free for everyone.
It saves our resources, because we don't have to run the test suite with coverage counting enabled (about twice as much time). The idea was to make the coverage statistics independent from the other CI runners, s.t. there is no interference and risk of breaking / slowing down anything. |
Is it ready to go then with the free 1 container? |
I would wait for @MartinNowak's feedback on his comment about injecting the source path. Maybe there's a smarter way. |
If we're evaluating dmd's coverage, we only need to build the test suite, not run it. |
Ideally skip the link step too for the runnable category. That'd cut a good amount of time out of the run. Do both of those and the time to add just that step to the existing builds shouldn't be much at all. |
Also, skip permuting the args unless the permuting is explicit in the test case source. |
Auto-merge toggled on |
I want to get this started! Can always improve it. |
The ideas to avoid run and link time are quite nice - I honestly didn't think they would result in a huge difference. I had a short look at the test_runner, but it will take me a bit of time to figure out a good way to hack it.
@WalterBright thanks! As said before I think you still need to enable CircleCi for dmd ;-) |
The link time is substantial, probably a lot more than the run time. |
I enabled it, and this is as far as it got:
|
I didn't got an answer for a critical question here, why should we add yet another CI provider, when there is no need for that? |
You can just make separate jobs for those, in a similar way that we add those |
I thought I explained the reasoning
Afaik I can read the error message at #6014, it fails because there is no
Well the maximal parallelization for Travis is 5 (if their queue is empty), so adding more jobs will directly add up to its total run-time and with coverage enabled took between 30 and 50 mins on Travis. |
OK, then let's keep it as it is for now. |
Yikes, CircleCI apparently doesn't merge PRs into the target branch before building them, please be aware of this subtle detail. Both the auto-tester and Travis-CI do this correctly. |
Seems like only a minor hack is required to compile coverage statistics for DMD. Maybe there is a better way to do this, but otherwise it is a very good use case of the new
__FILE_FULL_PATH__
.With this PR the coverage is run for both the tests & phobos. We have to see how much it affects the Travis runtime,
Of course as for dlang/druntime#1620, a next step would be to run coverage tests on the AutoTester too.
It can be previewed here.