karma-runner / karma-runner/karma

Normalized paths passed to reporters on windows causing problems

Open
#1,326 0 comments 0 reactions 0 assignees View on GitHub
type: backlog
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

All of the paths that are passed in via config.files appear to be normalized and, on windows, when those paths are then passed to the reporters it can cause issues. For instance, karma-coverage utilizes istanbul and the coverage object passed back to it keys all the results on the file names and paths, and then uses those file names and paths to create html reports. It attempts to find a common directory prefix(https://github.com/gotwarlost/istanbul/blob/master/lib/util/tree-summarizer.js#L24) utilizing the windows backslash path separator and fails, resulting in all of the html reports ending up in the wrong directory. The command line I've been using to reproduce it looks something like

```
karma start --browsers=PhantomJS --reporters=coverage --coverageReporter.type=html --coverageReporter.dir=allTestCoverage c:\path\to\config\config.js
```

Where config.js adds absolute paths for a number of files. Let me know if additional details are needed or this should be filed against karma-coverage or istanbul.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the shown Windows command and config.files paths, then trace how those paths reach the reporters and the coverage reporter. Compare the paths passed into karma-coverage and Istanbul with the paths used to create HTML reports; done means Windows coverage reports are created in the expected directory.

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.