Comments (8)
Could you give me the following info?
- What is the high-level use case? What specific command are you running? Is it
istanbul cover
? - Can you turn off reporting as part of running your tests and use the
istanbul report
command to produce the reports as a separate command? (seeistanbul help
for details). I want to make sure that it is not the test runner that is opening too many files and istanbul just happens to tip the # of open files over the limit. - Could you run the original command in node 0.8 and see if that makes any difference? Want to make sure it is not because of the node version.
Thanks for reporting the issue.
from istanbul.
My high-level use case is manually generating instrumented JS files with istanbul and then running Jasmine tests using Guard-Jasmine which will then feeds istanbul the results somehow and generates reports. I tried to read the code (relevant commit), but it's a bit too much for me to understand so early in the morning :)
Tried to run istanbul cover
without Guard-Jasmine, but got stuck with how to make it run Jasmine tests, I'm not using node at all just plain client side JS. It can very well be the case that there's something with the way Guard-Jasmine is using istanbul, if you think that's the case I can open an issue there.
It's also happening with node 0.8.22.
Edit: Actually, there's one more piece to the puzzle I just realised, I do get a report on the CLI from Guard-Jasmine:
Spec coverage summary:
Statements : 37.97% ( 6903/18178 )
Branches : 26.18% ( 2210/8443 )
Functions : 28.97% ( 1123/3876 )
Lines : 38.04% ( 6899/18135 )
Which implies that the coverage bit is completely fine, it's the HTML report generation which seems to break. This also lines up with what's in the stack trace, but thought I should mention.
from istanbul.
This is good information - it proves that the reporter is opening too many files at the same time and it is not a side effect of the test runner.
I'm totally tied up with my day job right now so may not be able to get to a fix soon.
This is how I think you can get unblocked:
- Fork this repo
- Change this line: https://github.com/gotwarlost/istanbul/blob/master/lib/command/report.js#L88 to read
reporter.writeReport(collector, true); /* sync mode */
- Use your fork in your package.json
Let me know if this unblocks you. I will get to a permanent fix when my current day-job deadlines are met.
from istanbul.
Yeah, I can reproduce it and, yeah, that fix should work.
I don't know what I was smoking when I wrote the async version of the reporter but it will take some time to untangle :)
Let me know if this is a workable solution for you for the time being.
from istanbul.
That worked perfectly, thanks
It's quite fast as well, so this is not a bad fix :)
I don't even have a package.json (it's a pure client side project with some Ruby gems for compilation sprinkled on top), but a little bit of Googling gave me the quick and dirty way: npm install git://github.com/daaain/istanbul.git -g
Edit: Oh yeah, and by the way it works with node 0.10.0!
from istanbul.
Cool. I'll roll in a fix in the next week or two.
from istanbul.
@daaain - Fix is available in v0.1.34.
Please try it and let me know if it looks ok. Thanks!
from istanbul.
It works perfectly (tested with node 0.10.2), thanks a lot for the fix!
from istanbul.
Related Issues (20)
- ignore lines of code by specifying the line numbers HOT 1
- Function to string without istanbul in runtime HOT 1
- Looking for Constantinople.js HOT 1
- is it possible to apply the effect from /* istanbul ignore next */ to all typescript private methods automagically?
- option to disable coverage on import lines
- Open Coverage File Automatically on Test Command? HOT 2
- Branches that don't exist get reported as missing
- how to use istanbul as a library
- Analyzing coverage of node server in Windows HOT 1
- exclude imported node modules from coverage reporting HOT 1
- Cannot get the backend coverage by running Cypress UI e2e test HOT 1
- Ignore implied "else"
- Coverage format documentation not explicitly stating 'end' meaning HOT 1
- Istanbul doesn't ignore nested if, when not executed
- Async package is vulnerable
- Coverage not being collected from file called "payload.ts"
- Fails when running `istanbul report` HOT 1
- Unit test branch for SignInPage showing the SignUpComponent
- Ignore docs could be clarified by adding a list of allowed keywords
- Code comments are being covered.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from istanbul.