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

Feature Request: Allow caching with the standalone instrument command #1203

Open
AndrewFinlay opened this issue Oct 10, 2019 · 7 comments
Open

Comments

@AndrewFinlay
Copy link
Contributor

Problem

The nyc instrument command could benefit from using a cache. This would speed up subsequent runs of nyc instrument that were using the same cache and be a big benefit to streaming instrumentation implementations.

Proposal

Add the caching options from the standard nyc command to nyc instrument

@coreyfarrell
Copy link
Member

I'm not strictly opposed to this idea but we'd need to be sure that any options which can alter results (such as --require) are properly handled for cache invalidation.

@AndrewFinlay
Copy link
Contributor Author

I've put up the start of a PR, it allows the instrument command to access the cache but doesn't do anything about cache invalidation. I was thinking of collecting any relevant settings and storing them in a file that would trigger a cache clean if the stored settings didn't match the current settings. Anyway I'm open to advice on how to implement this.

@coreyfarrell
Copy link
Member

I wonder if we add nycInstrumentCache to getInvalidatingOptions in lib/hash.js? This would force nyc instrument to cache to different filenames from normal nyc execution if. I assume you would use nyc --no-instrument when running your actual tests since the files are already transpiled so this shouldn't be an issue for performance.

Probably wouldn't hurt to also add require to the list in lib/hash.js but that wouldn't be adequate on it's own. The problem is how many people pass the --require options for mocha, I can say many do this based on the number of bugs about inconsistent --all coverage for TypeScript in nyc < 15.

@stale
Copy link

stale bot commented Jan 10, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jan 10, 2021
@AndrewFinlay
Copy link
Contributor Author

bump. Still relevant, from memory this needs work to finish.

@stale stale bot removed the stale label Jan 12, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Apr 16, 2022
@AndrewFinlay
Copy link
Contributor Author

bump, Still relevant, I'll take another look when there's some maintainer interest

@stale stale bot removed the stale label Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants