-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
Fix code coverage not gathered for project with enabled code coverage when running tuist test
#2501
Conversation
tuist test
tuist test
e765c59
to
97e0136
Compare
Hi @adellibovi! could you specify what For the current release Under the hood, So, from what I understand this change is not necessary. You have also stated that this PR will fix #2186 - is that the case, though? This does not solve the fact that the test results are saved into a derived data path. We should indeed provide a way to specify where the results will be saved which is related to this. |
@fortmarek oops, wrong mention of issue, I meant #2182, updated in the description too 😄 Regarding the version, I believe I tried with a branch up-to-date from main, and was still getting the tests run targets one by one 🤔 Update: I was using the branch only to generate the project, then, since this PR does not modify the test command, I was running |
ah, ok, I see Following up on the discussion from the issue:
I don't have a strong opinion on this but if I run A more delicate fix of the original issue would be something like this:
Because the issue is that we add code coverage only for the target itself but we should actually collect code coverage for the targets we want to test. |
Adding a comment for other reviewers, while having a chat offline with @fortmarek we also noticed that is worth mentioning that the default behavior of Xcode when enabling Code Coverage is to enable for all targets (as this PR) |
@kwridan do you have any thoughts on this? I think we can follow the Xcode's behavior and keep the PR as-is but it would be great to get the third opinion in here |
Both approaches have merit. Perhaps keeping the Xcode behaviour makes sense. I can imagine when running UI tests or integration tests you may want to see the coverage for all the dependent modules too. I guess if that isn't desired running the tests on the individual modules to see their coverage is still available. For example running AppUITests vs NetworkingTests AppUITests may include coverage or App, Networking, ... Vs NetworkingTests will include coverage of Networking (and its dependencies if has any) As a final measure, worth remembering users can create custom schemes and tailor it to their specific needs, so here it's a matter of picking a default behaviour we think applies best to most cases. Hope this helps 🙂 |
97e0136
to
8859846
Compare
@kwridan and @fortmarek not sure what we decided 😆 In any case, I rebased this PR and changed the changelog, as the fix for If I misunderstood, please clarify it for me so I can make the appropriate changes 😃 🙏 |
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.
I'm ok with keeping Xcode default behavior, approved ✅
8859846
to
23bb4e2
Compare
Resolves #2182
Request for comments document (if applies):
Short description 📝
Hi, as mentioned in #2182, currently running
tuist test
when having code coverage enabled for the project do not correctly gather code coverage.To try it out:
tuist generate
tuist test
Checklist ✅
CHANGELOG.md
has been updated to reflect the changes. In case of a breaking change, it's been flagged as such.