Make coverage, like, really fast#30811
Merged
jonahwilliams merged 5 commits intoflutter:masterfrom Apr 15, 2019
Merged
Conversation
zanderso
reviewed
Apr 9, 2019
| return <String, dynamic>{'type': 'CodeCoverage', 'coverage': coverage}; | ||
| } | ||
|
|
||
| List<int> _lineAndColumn(int position, List<dynamic> tokenPositions) { |
Member
There was a problem hiding this comment.
This method could use some comments.
Contributor
Author
There was a problem hiding this comment.
Added a description and a link to the vmservice documentation which describes the format
| ); | ||
| } | ||
| await Future.wait(futures); | ||
| final Map<Uri, Map<int, int>> hitMaps = <Uri, Map<int, int>>{}; |
Member
There was a problem hiding this comment.
To help with readability you might split this code up into some more functions.
Contributor
Author
There was a problem hiding this comment.
I refactored this into a method for loading and a method for building
zanderso
approved these changes
Apr 12, 2019
| for (Map<String, dynamic> range in sourceReport['ranges']) { | ||
| final Map<String, dynamic> coverage = range['coverage']; | ||
| final Map<String, dynamic> scriptRef = sourceReport['scripts'][range['scriptIndex']]; | ||
| final Uri uri = Uri.parse(scriptRef['uri']); |
Member
There was a problem hiding this comment.
Do you have to convert scriptRef['uri'] to a Uri object? It looks like all that's done with it is converting it back to a string in _toScriptCoverageJson.
Contributor
Author
|
Build is currently green - the dashboard may be unable to update older PRs |
jiahaog
added a commit
that referenced
this pull request
Jul 24, 2019
An optimization to the coverage collection speed was added in #30811. This commit further expands on it to parameterize the CoverageCollector with a custom predicate, allowing internal use cases to filter the RPC calls to the Dart VM based on scripts of interest to coverage collection.
johnsonmh
pushed a commit
to johnsonmh/flutter
that referenced
this pull request
Jul 30, 2019
…#36774) An optimization to the coverage collection speed was added in flutter#30811. This commit further expands on it to parameterize the CoverageCollector with a custom predicate, allowing internal use cases to filter the RPC calls to the Dart VM based on scripts of interest to coverage collection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Applies changes described in go/better-dart-coverage
Related Issues
Fixes #23157
Tests
I added the following tests:
Replace this with a list of the tests that you added as part of this PR. A change in behaviour with no test covering it
will likely get reverted accidentally sooner or later. PRs must include tests for all changed/updated/fixed behaviors. See Test Coverage.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?