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
Aggregate coverage from calls to subprocess #68
Comments
Sorry for the delay. I can have a look. IINM I need to run The first 3 uncovered spots I checked aren't indeed run, so which lines are you referring to? |
You need to run:
Or you can just focus on the CLI tests:
(no need to use Rake) |
I'll provide a specific example for what I know is hit, but isn't covered. Stay tuned. |
Btw, I also frequently get core dumps when using deep cover, which is maybe associated with using a child process or maybe not related. |
Oh yeah, and I just remembered you can use the focused test because that leads to:
^ It seems like deep cover fails in almost all cases when I try to filter the tests. I get all kinds of weird errors in the transform data routine. |
So here's a case. If I run the following command:
Then it says the truthy branch on line 222 ( It appears some hit lines are recorded, but not all. It seems like there are logic errors in the merging of the coverage data. |
The reporting takes forever 😮 |
Tell me about it. But given how vital the information is, I've learned to be patient ;) If it could go faster, I would be 🙏. |
Ah, I think I found the issue; should be in the HTML reporter (and only the HTML reporter), and it makes sense too. I'm not sure yet of what approach I can take, I'll keep you updated. |
That's fantastic and encouraging to hear! Thanks for the update. |
I'm both quite ashamed and happy to report that, testing with some of your code (~500 loc), I get the reporting down from 56 seconds down to 0.8 seconds. Doubling the LOC quadruples the original time to a ridiculous ~4 minutes, while the optimized time is ~15% slower than twice the time at 1.9 seconds. This is obtained by optimizing Now I have to figure out what's going on with the actual coverage, but at least I don't have to wait minutes for the report... |
Created whitequark/parser#683 ... |
Updating |
So I can confirm that the issue is that the code running via In your case, since the code is loaded by Let us know if it doesn't work as it should. |
@marcandre Aha! That makes a lot of sense.
Eek! Testing code in production code. Not that. But I see what you mean. I'll use a supplemental script to load it. Thanks for the pointers! I can't wait to see what the real numbers are. |
FYI, somehow nyc is able to do this in the Node world without the explicit require. I suspect they are doing some command manipulation. That's why I had just assumed deep cover would be loaded inside the CLI invocation. |
Interesting. I don't know how |
I'm pretty sure nyc intercepts the subprocess communication (though I'm fuzzy on the details at the moment). |
It seems to use NODE_OPTIONS to force itself to be required when the subprocess is called (assuming the subprocess is Node). This is similar to how Bundler bootstraps itself in a Ruby subprocess. |
I have several CLI tests in my test suite. The lines covered by these tests are not being reflected in the coverage report. How do I get the coverage data collected from these calls to be incorporated into the coverage report? Is there an additional setting or environment variable that I need to set?
Here's the test suite: https://github.com/asciidoctor/asciidoctor-pdf
The text was updated successfully, but these errors were encountered: