r3b / coverage-collector

a simple server for collection of code coverage objects
Apache License 2.0
0 stars 1 forks source link

Not sure how this listens to server under test #1

Open lwhiteley opened 10 years ago

lwhiteley commented 10 years ago

Hey i'm looking at this module to be able to collect coverage of an already running application that was instrumented by istanbul.

For eg. my app is running on port 8080 and coverage-collector is running on port 3001

How does it listen to the app running on another port to know what to collect?

This may need to be put in the Readme or something. Its not clear to me how to use this module.

Or do I have the wrong idea of how this is suppose to work?

r3b commented 10 years ago

Hi Layton,

The way I implemented this is just as an HTTP endpoint for an Istanbul collector. The running application would need to post data to the coverage collector running on the specified port. I made it specifically to be used with https://www.npmjs.org/package/grunt-protractor-coverage, though I have thought about expanding the functionality to make it more general-purpose.

Here are some examples of the usage:

Start the service

https://github.com/r3b/grunt-protractor-coverage/blob/master/tasks/protractor_coverage.js#L181-L182

Collect data

https://github.com/r3b/grunt-protractor-coverage/blob/master/resources/saveCoverage.tmpl#L3-L25 https://github.com/r3b/grunt-protractor-coverage/blob/master/resources/saveCoverage.tmpl#L29

Report data and shutdown the service

https://github.com/r3b/grunt-protractor-coverage/blob/master/tasks/protractor_coverage.js#L186-L209

I'm open suggestions and pull requests.

-ryan

On Wed, Oct 1, 2014 at 2:16 PM, Layton Whiteley notifications@github.com wrote:

Hey i'm looking at this module to be able to collect coverage of an already running application that was instrumented by istanbul.

For eg. my app is running on port 8080 and coverage-collector is running on port 3001

How does it listen to the app running on another port to know what to collect?

This may need to be put in the Readme or something. Its not clear to me how to use this module.

Or do I have the wrong idea of how this is suppose to work?

— Reply to this email directly or view it on GitHub https://github.com/r3b/coverage-collector/issues/1.