Skip to content

Cumbersome long filenames in show of coverage report. #50

@KeithWM

Description

@KeithWM

When running a coverage report, the filenames printed contain the full path, not just the path relative to the project root. I'm not sure if this is intentional, or a problem related to my system setup specifically. (Running coverage over LocalRegistry as it's an Open Source project I happened to have open at the time.)

┌────────────────────────────────────────────────────────────────────────┬───────┬─────┬──────┬─────┐      
│ Filename                                                               │ Lines │ Hit │ Miss │   % │      
├────────────────────────────────────────────────────────────────────────┼───────┼─────┼──────┼─────┤      
│ C:\\Users\\12345678\\.julia\\dev\\LocalRegistry\\src\\LocalRegistry.jl │   2612501196% │      
├────────────────────────────────────────────────────────────────────────┼───────┼─────┼──────┼─────┤      
│ TOTAL                                                                  │   2612501196% │      
└────────────────────────────────────────────────────────────────────────┴───────┴─────┴──────┴─────┘ 

I hacked a small implementation that removes the summary.pkgdir from the filename. This did require some juggling with the case of the drive letter (on Windows...), which did trigger me to think that maybe that was the only cause of the issue.

The output I get with my hacky fix is

┌─────────────────────────┬───────┬─────┬──────┬─────┐
│ Filename                │ Lines │ Hit │ Miss │   % │
├─────────────────────────┼───────┼─────┼──────┼─────┤
│ \\src\\LocalRegistry.jl │   2612501196% │
├─────────────────────────┼───────┼─────┼──────┼─────┤
│ TOTAL                   │   2612501196% │
└─────────────────────────┴───────┴─────┴──────┴─────┘

So is the default behaviour I see intentional? And if so is the fix I implemented welcome?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions