Skip to content

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

Closed
nickclmb opened this issue Aug 2, 2018 · 7 comments
Closed

Collect coverage for browser tests in dart 2 #446

nickclmb opened this issue Aug 2, 2018 · 7 comments
Labels
package:coverage type-enhancement A request for a change that isn't a bug type-question A question about expected behavior or functionality

Comments

@nickclmb
Copy link

nickclmb commented Aug 2, 2018

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

@cbracken
Copy link
Member

cbracken commented Aug 13, 2018

/cc @grouma who may be able to provide some suggestions based on how we do this internally at Google.

@cbracken cbracken added type-enhancement A request for a change that isn't a bug type-question A question about expected behavior or functionality labels Aug 13, 2018
@grouma
Copy link
Member

grouma commented Aug 13, 2018

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.

@cbracken
Copy link
Member

cbracken commented Aug 13, 2018

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.

@grouma
Copy link
Member

grouma commented Aug 13, 2018

Definitely open to some pull request baking in support for coverage collection inside package:test regardless of platform.

@cbracken
Copy link
Member

cbracken commented Aug 14, 2018

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).

@robbecker-wf
Copy link
Contributor

Ping. Are we just waiting for https://bugs.chromium.org/p/chromium/issues/detail?id=717195

@cbracken
Copy link
Member

cbracken commented Oct 22, 2018

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).

@mosuem mosuem transferred this issue from dart-archive/coverage Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:coverage type-enhancement A request for a change that isn't a bug type-question A question about expected behavior or functionality
Projects
None yet
Development

No branches or pull requests

5 participants