-
Notifications
You must be signed in to change notification settings - Fork 53
Collect coverage for browser tests in dart 2 #446
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
Comments
/cc @grouma who may be able to provide some suggestions based on how we do this internally at Google. |
Internally we use Node, Istanbul and Remap-Istanbul. Basically before we return JS code, we instrument it with istanbul. After the tests run we collect the coverage information and map it back to Dart using remap-istanbul. It works but is quite slow. We have plans to use the fairly new coverage feature of Chrome. I have a proof of concept and hope to add full support to package:test later this year. |
Thanks! If this will land directly in package:test, that works out even better than packaging it here. If coverage support is planned to be baked into upcoming versions of package:test, is there a plan to also support coverage collected from the VM service for VM/Flutter coverage? If not, any objections to some pull requests to do that once the APIs are decided on? I'd love for us to be able to eliminate the current manual process of kicking off tests with isolates wedged, then kicking off the tools from this package to perform the collection. We'd likely still need some equivalent to a couple of the APIs here to be able to shim them into Flutter's coverage collector -- specifically the bits we wire up in flutter_platform.dart in the Flutter repo. |
Definitely open to some pull request baking in support for coverage collection inside package:test regardless of platform. |
Good to hear! I'll treat this issue as a dupe of dart-lang/test#36. Now that Dart 2 is out and Dartium is dead, I'll resolve this issue by removing the instructions for collecting coverage in Dartium. @nickclmb definitely throw a thumbs-up on that issue (we use them to help us quantify support). |
Ping. Are we just waiting for https://bugs.chromium.org/p/chromium/issues/detail?id=717195 |
Hi @robbecker-wf - browser-side coverage is now tracked by dart-lang/test#36. You can thumbs-up/track progress there. This package will remain focused on collecting code coverage from any place a Dart VM is available (standalone VM, Flutter, any custom VM embedders). |
Since dartium is deprecated, and there seems no way to connect to observatory from Chrome with ddc - the question is how to collect coverage now for browser tests?
Readme keep saying to use dartium though, but it is deprecated, has Dart 1 SDK built-in, and browser tests won't actually work with dartium.
Thanks
The text was updated successfully, but these errors were encountered: