-
Notifications
You must be signed in to change notification settings - Fork 34
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
Allow specifying coverage flags via a yaml file #532
Comments
Hey @liamappelbe I can work on this issue |
@khushi-hura The first step is to collect all our tool's command line flags and figure out if any collide, if any are deprecated or redundant, and figure out how we want to structure them in a yaml file. Why don't you look into it and post your findings here, and if your answers looks good I'll assign the bug to you and you can start implementing it. That'll be easier than getting my feedback on the design after you've already implemented it. |
Hi @liamappelbe I have made some progress on this issue and have compiled all the details in Notion Document. Here's a quick summary:
I’d appreciate it if you could review the document and share your feedback. If everything looks good, kindly assign this task to me. |
Sorry for the slow response, I was away for Christmas. Looks like I'm 1 day too late to review your design before you sent out the PR, so there might be some churn, sorry 😅. Let's nail down the yaml format before I review the PR. Some high level comments on your design (I'll use "flags" to refer to both flags and options, since the distinction only matters in the
With that in mind, I reviewed your design and thought about which flags the yaml file should include. After I did that, I realized I'd basically ended up with the list of flags that test_with_coverage.dart supports (which makes sense, since that's the script that is designed to support the common use cases), but the other tools should also look at this yaml file for their flags. I didn't include So I think the yaml structure should look like this: package: 'path/to/package' # Defaults to '.'
package-name: 'package' # Deduced from package directory by default
out: 'path/to/output/directory' # Defaults to '$packageDirectory/coverage'
test: 'path/to/test.dart' # Defaults to test
function-coverage: false # Defaults to false
branch-coverage: false # Defaults to false
scope-output: # A list that defaults to containing only the name of the package
- 'package'
- 'package2' Also, we might want to use package:cli_config for this, since this is what it's designed for. I haven't used that package before, but their flags look like |
Hi @liamappelbe, Thanks for getting back to me, and no worries about the delay! I really appreciate the detailed feedback. 😊 Here’s what I think about the points you mentioned:
Let me know what you think about these points, and based on your feedback, I’ll update the PR to align with the decided approach. |
I don't see a good reason why the config should contain those flags. For flags that vary between runs, it's actually less convenient for the user to put them in a config than to specify them on the command line. Why would anyone want to do it? It's very easy to add more flags to the config in future, but hard to remove them (without breaking users). So we should be careful about the flags we add. We should only add flags we think are going to actually be useful. We can add more of the flags later if users ask for them.
|
Hi @liamappelbe, Thanks for clarifying! That totally makes sense to me now. I'll update the PR to incorporate these changes. Let me know if there's anything else you'd like me to tweak. 😊 |
Hi @liamappelbe I’ve removed all device-specific flags. However, I’ve currently included the following flags, which I believe are uncommon. If we only need to support common flags, we can remove these:
Let me know your thoughts on whether these should be retained or removed. |
Yeah, those should all be removed from the yaml.
One issue I just thought of is that some of the default values we want here are different to the default flag values in the tools. wait-paused, resume-isolates, and check-ignore should all default to true when using the yaml workflow, but in collect_coverage and format_coverage they default to false (for historical reasons). In test_with_coverage they default to true (in fact they're not even settable flags). My first thought was to default the flags to true if the user is using the yaml workflow, but that would be really confusing (adding a particular file in a particular location changes the default values of certain flags?). It also doesn't really make sense to include them in the yaml because they wouldn't have any effect in test_with_coverage. Another option would be to only check the yaml file in test_with_coverage, but that also seems a bit confusing to me. So let's just leave those flags out for now, and I'll decide what to do about them later. |
Thanks for your detailed explanation! I’ve removed all the mentioned flags for now and pushed the updated code. |
@Dhruv-Maradiya when your PR is ready for review, add me as a reviewer and I'll take a look. Remember to update the PR description with the new design. |
Hi @liamappelbe, it seems I don't have the permissions to assign you as a reviewer. The PR is ready for your review. |
Spin off of #510
It's a common pattern for Dart tools to read the default values for all their command line flags from yaml. This lets developers specify flag values once per project, and not have to remember/retype them each time. We should do this for package:coverage's flags.
There are a couple of open questions:
The text was updated successfully, but these errors were encountered: