Open osher opened 3 years ago
yea, I know it's frustrating, I saw how the other issue fell in the abyss. but I would like to help with that - and I'm ready for a lot:
Osher
I'm still standing, yea yea yea...
Oh, aaai - I'm still alive, yeeoo
I was not able to reproduce the error by cloning and running it on my own machine.
I've tried both v14 and v15, it is working as intended.
nyc mocha
HelloWorld
√ should return hello world with no arguments
√ should return passed argument
2 passing (15ms)
---------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
helloWorld.js | 100 | 100 | 100 | 100 |
---------------|---------|----------|---------|---------|-------------------
System:
OS: Windows 10 10.0.21286
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 5.58 GB / 15.86 GB
Binaries:
Node: 15.0.1 - E:\CodeProgram\Node\node.EXE
npm: 7.5.2 - E:\CodeProgram\Node\npm.CMD
npmPackages:
nyc: ^14.0.0 => 14.0.0
WTF. I also just cloned a project where it worked on windows. It tried on v15.1, v15.1 and v14 and they all worked, the culprit is not there.
I'll find the differences and update, but will be able to do it next week.
bullseye! 🎯 I manage to find a reproduction scenario. @Darkripper214 - lets hope it's the only one.
when I posted the issue I edited out parts from the paths because I did not think it makes a difference. But evidently, it did, because one of the edited out path folders was a symlink (junction).
I use a symlink because the ops guys destroyed my name when creating my ldap username. By the time I got to open a ticket to fix that - they could fix everything except for the original underlying LDAP username - and sadly, that happens a lot with my consultation customers. So I hide it with a symlink, and since I did not want my name in the bug description - I edited it out.
Anyway - see for yourself:
C:\git clone https://github.com/mariszin/nyc-coverage-0-sample
//... bla bla bla...
C:\cd nyc-coverage-0-sample
C:\nyc-coverage-0-sample>npm i
// ... bla bla bla ...
C:\nyc-coverage-0-sample>nyc mocha
HelloWorld
√ should return hello world with no arguments
√ should return passed argument
2 passing (14ms)
---------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
helloWorld.js | 100 | 100 | 100 | 100 |
---------------|---------|----------|---------|---------|-------------------
C:\nyc-coverage-0-sample>cd ..
C:\>mklink /J nyc-coverage-0-sample-symlink nyc-coverage-0-sample
Junction created for nyc-coverage-0-sample-symlink <<===>> nyc-coverage-0-sample
C:\>cd nyc-coverage-0-sample-symlink
C:\nyc-coverage-0-sample-symlink>nyc mocha
HelloWorld
√ should return hello world with no arguments
√ should return passed argument
2 passing (14ms)
---------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
helloWorld.js | 0 | 0 | 0 | 0 | 1-9
---------------|---------|----------|---------|---------|-------------------
C:\nyc-coverage-0-sample-symlink>
This leads me to suspect that when symlinks are involved nyc
may be watching the wrong paths
@Darkripper214 - whats the procedure here, should I update the bug description above to make it easier for future readers that land on the issue from something they googled? I mean, is that something you do here, or you prefer to preserve the narrative?
ha. I've got it.
follow up here: https://github.com/istanbuljs/test-exclude/issues/46
actually, we may not need to wait for the PR on test-exclude
if we pass it from nyc
side a path already resolved through fs.realpath
.
LMK what you think.
@Darkripper214 - sup?
Summary: I found the culprit, it's in test-exclude. We can wait for them, or we can pass them an already resolved path. @Darkripper214 - what do you think?|
omg. sorry for the noise. I thought I was getting maintainers in the autocomplete when I type"@".
@coreyfarrell, you look a frequent committer on both projects - are you a maintainer of this project? Can we have your opinion?
so. what's the move?
Same problem here. This time, SUBST
-based. See https://github.com/istanbuljs/test-exclude/issues/46#issuecomment-873377302
any decision?
I hope that nyc
gets fixed for Windows and updated, I'd like to use it, but right now it's not usable on Windows at all.
Link to bug demonstration repository
https://github.com/mariszin/nyc-coverage-0-sample
(Taken from #1076...)
Expected Behavior
After tests, nyc should show 100% coverage
Observed Behavior
When running tests on Windows, the coverage is 0. Not even after upgrading to
nyc@15
Troubleshooting steps
cache: false
in my nyc configEnvironment Information