-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Use istanbul-lib-hook to wrap require and support vm hooks #308
Conversation
Some questions:
Link main issue for cross-ref: #292 |
Changes Unknown when pulling d28153c on gotwarlost:libhook into * on istanbuljs:master*. |
No idea why the appveyor build is failing. Need help. |
@gotwarlost AppVeyor just fails a good chunk of the time, nothing to do with this pull as long as I can tell. re-kicked it off. |
description: 'should nyc wrap vm.runInThisContext?' | ||
}) | ||
.option('hook-create-script', { | ||
default: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we've tried to be fairly batteries included so far, for instance we already instrument subprocesses right out of the gate. I might be tempted to default this to true
. I'm happy with the argument name 👍
This is looking great 🎉 to land this I think all we'd need to to do would be:
|
Thanks for the detailed feedback.
|
@gotwarlost awesome, are you feeling like we're getting close to being able to point existing Istanbul users towards the Istanbul 1.0 APIs, and nyc? I've been having great luck as I test the new libraries against everything I throw at them, awesome work :) I wish we'd kicked this in motion sooner! |
Changes Unknown when pulling 03866c9 on gotwarlost:libhook into * on istanbuljs:master*. |
@bcoe I think we are getting real close, it's probably already much better than I think a big gap from |
OK, the latest commit has all the PR comments included in it. Please take a look. I can squash commits after things look ok. Specifically, please check bundle dependency changes in |
Also, I'm not sure if |
@gotwarlost this is feeling like a coveralls.io issue, I find there's a lot of weirdness with various services when I transfer repo ownership. |
Interface changes
--hook-run-in-context
(default:true
) to thenyc
command line--temp-directory <dir>
to thereport
command line. This is not a full implementation of a customizabletmpdir
but only the bare minimum required to support self-coverage reporting fornyc
. The full implementation is described in Add the ability to specify a custom tempDirectory #171Misc changes
istanbul
dev dependency in favor of APIs that are already being used, so that we don't accidentally use code from the old module any more. (I think thetext
reporter was being pulled in from the old lib).nyc
itself at the end of tests and this necessitates the customtemp-directory
option for reporting.Implementation
require
and hookvm.runInThisContext
--hook-run-in-context
option and propagate to subprocesses using theNYC_HOOK_RUN_IN_CONTEXT
environment varrunInThisContext
is successfully hooked.istanbul
API use withistanbul-lib-instrument
and command line use withnyc
itself.