Skip to content
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

Needs to be updated to support Dart 1.16 service protocol #107

Closed
pulyaevskiy opened this issue Apr 27, 2016 · 15 comments
Closed

Needs to be updated to support Dart 1.16 service protocol #107

pulyaevskiy opened this issue Apr 27, 2016 · 15 comments
Assignees
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@pulyaevskiy
Copy link

I haven't upgraded to 1.16 yet, but Travis builds suddenly started to fail with following error:

$ pub global run coverage:collect_coverage --port=8111 -o coverage.json --resume-isolates
JSON-RPC error -32601 (method not found): Method not found
package:json_rpc_2/src/client.dart 99            Client.sendRequest
package:json_rpc_2/src/peer.dart 94              Peer.sendRequest
package:coverage/src/vm_service_client.dart 198  VMServiceClient.getCoverage.<async>
===== asynchronous gap ===========================
dart:async                                       Future.Future.microtask
package:coverage/src/vm_service_client.dart      VMServiceClient.getCoverage
package:coverage/src/collect.dart 41             _getAllCoverage.<async>
dart:async                                       _SyncCompleter.complete
package:vm_service_client/src/isolate.dart 232   VMIsolateRef.load.<async>
dart:async                                       _SyncCompleter.complete
package:vm_service_client/src/scope.dart 51      Scope.sendRequest.<async>
dart:async                                       _SyncCompleter.complete
package:json_rpc_2/src/client.dart 178           Client._handleSingleResponse
package:json_rpc_2/src/client.dart 168           Client._handleResponse
dart:async                                       _StreamController.add
package:json_rpc_2/src/peer.dart 117             Peer.listen.<fn>
===== asynchronous gap ===========================
dart:async                                       _asyncThenWrapperHelper
package:coverage/src/collect.dart                _getAllCoverage
package:coverage/src/collect.dart 26             collect.<async>
dart:async                                       _SyncCompleter.complete
package:coverage/src/util.dart 39                retry.<async>.<fn>.<async>
dart:async                                       _SyncCompleter.complete
package:coverage/src/vm_service_client.dart 90   VMServiceClient.connect.<async>
===== asynchronous gap ===========================
dart:async                                       _asyncThenWrapperHelper
package:coverage/src/collect.dart                collect
http://localhost:52493/collect_coverage.dart 21  main.<async>.<fn>.<async>
===== asynchronous gap ===========================
package:stack_trace                              Chain.capture
http://localhost:52493/collect_coverage.dart 20  main.<async>

Example of a full build log: https://travis-ci.org/corsac-dart/bootstrap/builds/125995686

coverage package is enabled via pub global activate and the log shows that some packages are not latest version, e.g.:

$ pub global activate coverage
Resolving dependencies... (1.5s) 
+ args 0.13.4
+ async 1.10.0
+ collection 1.5.1
+ coverage 0.7.3
+ json_rpc_2 1.2.0 (2.0.1 available)
+ logging 0.11.3
+ path 1.3.9
+ pub_semver 1.2.4
+ source_span 1.2.2
+ stack_trace 1.6.5
+ vm_service_client 0.1.3 (0.2.0 available)

I'm wondering if that's the reason, and if we need an updated version of this package published with latest dependencies?

@travissanderson-wf
Copy link

We are seeing the same thing with our build systems

@kevmoo
Copy link
Member

kevmoo commented Apr 27, 2016

Related - dart-archive/vm_service_client#6

@kevmoo
Copy link
Member

kevmoo commented May 5, 2016

FYI: I'm working hard to get this resolved

I'm almost ready to land the fix (https://codereview.chromium.org/1929063002/) for the blocking issue (dart-archive/vm_service_client#6)

I've already started on migrating the coverage package to this.

@travissanderson-wf
Copy link

Thanks for the update, I saw movement in the vm_service_client and figured as much but appreciate the post.

@kevmoo kevmoo added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label May 5, 2016
@kevmoo kevmoo changed the title Dart 1.16: collect coverage fails with JSON-RPC error -32601 (method not found) Needs to be updated to support Dart 1.16 service protocol May 20, 2016
@kevmoo
Copy link
Member

kevmoo commented May 20, 2016

We've got the vm_service_client updated.

I'm doing work here - https://github.com/dart-lang/coverage/tree/migration

I'd really like to parse down what coverage does.

Is anyone consuming it for something other than coveralls.io?

@pulyaevskiy
Copy link
Author

I have couple builds for codecov. Would be happy to help

@evanweible-wf
Copy link

@kevmoo all of our packages at Workiva use codecov, although we collect coverage via dart_dev. It essentially just combines the two steps from this package (collect and format) into a single task, handles merging coverage if the package has multiple suites, and a few other things like auto-generating an HTML file and generating the HTML report. It's always been brittle though, so I'm not opposed to change. I'm also happy to help!

@kevmoo
Copy link
Member

kevmoo commented May 20, 2016

@evanweible-wf do you have sample code? What format do you use for upload, etc?

@evanweible-wf
Copy link

Sure. The reporting to codecov part is easy, they supply a bash script that takes a correctly formatted coverage file (lcov, gcov, json, etc):

pub run dart_dev coverage --no-html
bash <(curl -s https://codecov.io/bash) -f coverage/coverage.lcov

https://github.com/Workiva/w_transport/blob/master/.travis.yml#L13-L14

The coverage task in dart_dev handles running the coverage executables across a set of test files and producing a single .lcov file: https://github.com/Workiva/dart_dev/blob/master/lib/src/tasks/coverage/api.dart

@donny-dont
Copy link

@kevmoo I use https://aircover.co/ for my stuff. It takes in lcov and then pushes it to the server. The pushing is done in a plugin so the lcov just needs to be hanging out somewhere on the disk.

@kevmoo
Copy link
Member

kevmoo commented May 26, 2016

With this pull request - #108 - we have the ability to connect to a running dart app (with the vm service enabled) and collect LCOV coverage info.

I'll work with @cbracken to review the code. If you're itchy to get coverage working on your app, you could try out the code on your own box.

I've cleaned up the API and the binaries A LOT. Let me know if you miss anything I've removed.

@cbracken
Copy link
Member

cbracken commented May 28, 2016

For anyone who needs SDK 1.16.0 support straight away while #108 is in review, I've pushed a branch containing the version we use inside Google for code coverage. It's a fairly minimal patch on a slightly older release than what's on master, but has the advantage of being entirely backward-compatible and feature identical to the currently released version while working on newer SDKs.

Will discuss with @dgrove and @nex3 early next week to decide on the approach we want to take to get something released.

@cbracken
Copy link
Member

cbracken commented Jun 2, 2016

Closed by 521c4e5. Released in version 0.7.4.

@cbracken cbracken closed this as completed Jun 2, 2016
@alexander-doroshko
Copy link

Verified that coverage works again in WebStorm 2016.2, thanks a lot!

@cbracken
Copy link
Member

cbracken commented Jun 2, 2016

Thanks for verifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants