Coder Social home page Coder Social logo

Comments (5)

denisrossetre avatar denisrossetre commented on July 1, 2024 1

Actually, I solved the problem! The thing is that the path parsing will be done on a Unix path in a Windows system.

By changing the value
"coverage-gutters.remotePathResolve": ["/opt/local", "c:/Users/myusername/projects/myprojectname"]
to
"coverage-gutters.remotePathResolve": ["\\opt\\local", "."]
the problem disappeared (the second value "." does not matter so much, but I prefer relative paths for the local dev system as they are more stable).

To close this issue, I'd like to write a bit of documentation for the remotePathResolve setting. Would you accept a PR, and if so, where should I put the documentation?

from vscode-coverage-gutters.

ryanluker avatar ryanluker commented on July 1, 2024

@denisrossetre Thanks for the ticket! Are you able to grab more logs from the extension output log area?
Screenshot from 2023-04-08 14-43-12

In terms of extra logging, check out this area, and you could maybe remove the .size to print the whole cache and that would assist us in figuring out what is inside (this should really be an extension setting to enable "verbose" logging mode but sadly haven't got to that yet 😓).

const dataCoverage = await this.coverageParser.filesToSections(dataFiles);
this.outputChannel.appendLine(
`[${Date.now()}][coverageservice]: Caching ${dataCoverage.size} coverage(s)`,
);
this.cache = dataCoverage;

from vscode-coverage-gutters.

ryanluker avatar ryanluker commented on July 1, 2024

Actually, I solved the problem! The thing is that the path parsing will be done on a Unix path in a Windows system.

By changing the value "coverage-gutters.remotePathResolve": ["/opt/local", "c:/Users/myusername/projects/myprojectname"] to "coverage-gutters.remotePathResolve": ["\\opt\\local", "."] the problem disappeared (the second value "." does not matter so much, but I prefer relative paths for the local dev system as they are more stable.

To close this issue, I'd like to write a bit of documentation for the remotePathResolve setting. Would you accept a PR, and if so, where should I put the documentation?

I am glad you got it figured out 👍🏻 !
More documentation is always welcome, so PR will definitely be accepted, thanks.

I think the tips and tricks section would be a good fit? It gets great SEO from being on the front page + in the marketplace.
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
https://github.com/ryanluker/vscode-coverage-gutters#tips-and-tricks

from vscode-coverage-gutters.

ralittl avatar ralittl commented on July 1, 2024

@denisrossetre I'm encountering the same issue that you were -- I'm using Windows 10, and I have a docker container running Linux, but coverage gutters isn't showing the code coverage in VSC.

I tried using your fix, here is my settings.json

"coverage-gutters.coverageFileNames": [
        "coverage.xml",
        "lcov.info",
        "cov.xml",
        "jacoco.xml"
    ],
    "coverage-gutters.remotePathResolve": [
        
        [
            "\\home\\dev\\Mxxxx",
            "."
        ]
    ]

The /home/dev/M... path is what I'm using in the container.

In the CG log I see this:

[1698181260483][coverageservice]: c:\Users\Exxxxxxxx\gitlab\Mxxxx\coverage.xml
[1698181260483][coverageservice]: Loaded 1 data file(s)
[1698181260488][coverageservice]: Caching 6 coverage(s)
[1698181260488][coverageservice]: READY
[1698181260488][coverageservice]: RENDERING
[1698181260488][coverageservice]: READY

so I know that it's picking up my coverage file, but there's just still no visual indication on the file, and the bottom bar still shows "No coverage".

Did you end up having to do anything else other than changing this setting, to fix the issue? I'm running Coverage Gutters v2.11.0

from vscode-coverage-gutters.

ryanluker avatar ryanluker commented on July 1, 2024

@denisrossetre I'm encountering the same issue that you were -- I'm using Windows 10, and I have a docker container running Linux, but coverage gutters isn't showing the code coverage in VSC.

I tried using your fix, here is my settings.json

"coverage-gutters.coverageFileNames": [
        "coverage.xml",
        "lcov.info",
        "cov.xml",
        "jacoco.xml"
    ],
    "coverage-gutters.remotePathResolve": [
        
        [
            "\\home\\dev\\Mxxxx",
            "."
        ]
    ]

The /home/dev/M... path is what I'm using in the container.

In the CG log I see this:

[1698181260483][coverageservice]: c:\Users\Exxxxxxxx\gitlab\Mxxxx\coverage.xml
[1698181260483][coverageservice]: Loaded 1 data file(s)
[1698181260488][coverageservice]: Caching 6 coverage(s)
[1698181260488][coverageservice]: READY
[1698181260488][coverageservice]: RENDERING
[1698181260488][coverageservice]: READY

so I know that it's picking up my coverage file, but there's just still no visual indication on the file, and the bottom bar still shows "No coverage".

Did you end up having to do anything else other than changing this setting, to fix the issue? I'm running Coverage Gutters v2.11.0

@ralittl Hmm I think you might want to try one level of array instead?
"coverage-gutters.remotePathResolve": ["\\home\\dev\\Mxxxx", "."]

Also, once you get the system working, try out the watch button in the bottom status bar and you should get an output similar to the following:

[1699830894119][coverageservice]: INITIALIZING
[1699830925569][coverageservice]: LOADING
[1699830925644][coverageservice]: Loading 7 file(s)
[1699830925644][coverageservice]: /home/ryan/Dev/vscode-coverage-gutters/example/node/lcov.info,/home/ryan/Dev/vscode-coverage-gutters/example/remote-node/lcov.info,/home/ryan/Dev/vscode-coverage-gutters/example/ruby/lcov.info,/home/ryan/Dev/vscode-coverage-gutters/example/java/my-app/cov.xml,/home/ryan/Dev/vscode-coverage-gutters/example/php/cov.xml,/home/ryan/Dev/vscode-coverage-gutters/example/python/cov.xml,/home/ryan/Dev/vscode-coverage-gutters/example/multimodule-java/jacoco.xml
[1699830925646][coverageservice]: Loaded 7 data file(s)
[1699830925670][coverageservice]: Caching 19 coverage(s)
[1699830925670][coverageservice]: READY
[1699830925670][coverageservice]: RENDERING
[1699830925670][renderer][section file path]: ./node/test.js
[1699830925671][renderer][section file path]: ./node/test.js
[1699830925671][coverageservice]: READY
[1699830925671][coverageservice]: Listening to file system at {/home/ryan/Dev/vscode-coverage-gutters/example}/**/{lcov.info,cov.xml,coverage.xml,jacoco.xml,coverage.cobertura.xml}
[1699830933310][coverageservice]: RENDERING
[1699830933311][renderer][section file path]: ./node/test.js
[1699830933311][coverageservice]: READY

from vscode-coverage-gutters.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.