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

Test_runner: --experimental-test-coverage generates partial file names #51299

Closed
fawazahmed0 opened this issue Dec 28, 2023 · 5 comments · Fixed by #54379
Closed

Test_runner: --experimental-test-coverage generates partial file names #51299

fawazahmed0 opened this issue Dec 28, 2023 · 5 comments · Fixed by #54379
Labels
good first issue Issues that are suitable for first-time contributors. test_runner Issues and PRs related to the test runner subsystem.

Comments

@fawazahmed0
Copy link

fawazahmed0 commented Dec 28, 2023

Version

v21.5.0

Platform

Microsoft Windows NT 10.0.22621.0 x64

Subsystem

No response

What steps will reproduce the bug?

This issue only happens in windows; mac works fine.

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

No response

What do you see instead?

I see partial file names

Here is the coverage report generated in windows:

# start of coverage report
# ------------------------------------------------------------------------------------------------------------------------------------------------------
# file     | line % | branch % | funcs % | uncovered lines
# ------------------------------------------------------------------------------------------------------------------------------------------------------
# …test.js | 100.00 |   100.00 |  100.00 | 
# …test.js | 100.00 |    88.89 |  100.00 | 
# …ties.js |  28.96 |    53.33 |   14.29 | 22-27 37-50 56-61 64-75 77-79 81-87 115 119-132 146-148 152-154 156-158 160-164 166-174 177-180 182-184 186…
# ------------------------------------------------------------------------------------------------------------------------------------------------------
# all fil… |  39.07 |    72.41 |   30.00 |
# ------------------------------------------------------------------------------------------------------------------------------------------------------
# end of coverage report

Here is my complete command:

node --test --test-concurrency=1 --experimental-test-coverage --test-reporter=tap --test-reporter-destination=code/test/testlog.tap code/test/*.test.js

Additional information

The issue happens if my test.js files contains const {somefunc} = require('../mymodule') i.e importing module by relative path

@VoltrexKeyva VoltrexKeyva added the test_runner Issues and PRs related to the test runner subsystem. label Dec 28, 2023
@MoLow MoLow added the good first issue Issues that are suitable for first-time contributors. label Jan 2, 2024
@MoLow
Copy link
Member

MoLow commented Jan 2, 2024

if anyone is intrested in tackling this issue, the width of the columns is calculated here:

const minFilePad = MathMin(8, filePadLength);
filePadLength -= MathFloor(columnsExtras * 0.2);
filePadLength = MathMax(filePadLength, minFilePad);
// Get rest of available space, subtracting margins
uncoveredLinesPadLength = MathMax(availableWidth - columnsWidth - (filePadLength + 2) - 2, 1);

@ArchitGajjar
Copy link

Hi @fawazahmed0 @MoLow - can you please assign this to me, I am interested in this issue. Thank you!

@MoLow
Copy link
Member

MoLow commented Jan 4, 2024

@ArchitGajjar seems like #51351 is already open, anyway, we don't assign issues to people.

@atlowChemi atlowChemi linked a pull request Jan 5, 2024 that will close this issue
@saloni0419
Copy link

Is this issue solved #51299 @MoLow @fawazahmed0

@buzzinJohnnyBoi
Copy link

Hello, I have run several tests on this issue and the problem occurs on my dad's windows 10 computer and my Ubuntu 22.04 PC.
However, it works correctly on my winodws 11 laptop.

I am just starting to get into contributing to open-source, and I thought this would be a good first challenge for me.

If this issue is not solved #51351 @Medhansh404 @MoLow @fawazahmed0 then I would like to take a crack at it.

Thanks, John

@aduh95 aduh95 closed this as completed in 50136a1 Sep 18, 2024
targos pushed a commit that referenced this issue Oct 4, 2024
Co-author: Medhansh404 <[email protected]>
PR-URL: #54379
Fixes: #51299
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
louwers pushed a commit to louwers/node that referenced this issue Nov 2, 2024
Co-author: Medhansh404 <[email protected]>
PR-URL: nodejs#54379
Fixes: nodejs#51299
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
tpoisseau pushed a commit to tpoisseau/node that referenced this issue Nov 21, 2024
Co-author: Medhansh404 <[email protected]>
PR-URL: nodejs#54379
Fixes: nodejs#51299
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that are suitable for first-time contributors. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
7 participants
@MoLow @ArchitGajjar @fawazahmed0 @VoltrexKeyva @saloni0419 @buzzinJohnnyBoi and others