karma-runner / karma-runner/karma-coverage

Coverage path length issue

Open
#507 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
771
Forks
242
PR merge metrics
No merged PRs in 30d

Description

Hi

So recently migrated over to this package, and since we have a mono-repo of a front-end, which includes multiple different path and sometimes a few nested components. When trying to view a coverage report, I came across this error:
![image](https://github.com/user-attachments/assets/f0fb3f81-696c-4c2e-8b22-b9b070f2454d)
After some investigations I found out the problem was to do with the path character length, which exceeded 260 characters (excluding the `file://C:/Users/` Is there a way to possibly take this length into consideration? Not sure how many people would be affected by this, but you wouldn't be able to view the reports on any browser because of the limit. See below a link for windows length limits
[Windows path limit](https://learn.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation)

Here is a stackoverflow explaining it more: [stackOverflow](https://stackoverflow.com/questions/1880321/why-does-the-260-character-path-length-limit-exist-in-windows)

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by locating the coverage report generation and browser report path handling in karma-coverage, then reproduce the issue with a Windows path exceeding 260 characters. Done means coverage reports remain viewable in a browser for the long-path scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.