Comments (6)
@Foshkey Thanks for submitting an issue!
You might want to look into using the multi-root workspace functionality (see link from the example project or this link to vscode's docs).
This will allow you to have multiple "folders" or projects open at one time and have the coverage be accessible across different projects.
We can triage and investigate further if it is still an issue for you afterwords.
from vscode-coverage-gutters.
Thanks for the response!
Looks like it's still an issue. To be clear, our github repo is structured like so:
root
|- src
|- Project1
|- Project1.csproj
|- Project2
|- Project2.csproj
|- Project3
|- Project3.csproj
|- Project4
|- Project4.csproj
|- tests
|- unit
|- Project1.Tests
|- Project1.Tests.csproj
|- Project2.Tests
|- Project2.Tests.csproj
|- Project3.Tests
|- Project3.Tests.csproj
|- Project4.Tests
|- Project4.Tests.csproj
And opening the root
github folder is how most devs operate their workspace.
But, I tried adding all of the src project folders and test project folders to the workspace as separate folders like you suggested, but still the same issue that code gutters indicate no code coverage when all test projects are configured to output code coverage (but still works with just one project)
from vscode-coverage-gutters.
A coworker of mine came up with the suggestion to merge the coverage results with the following test runner arguments:
/p:CollectCoverage=true /p:CoverletOutputFormat=lcov%2cjson /p:CoverletOutput=../CoverageResults/ /p:MergeWith=../CoverageResults/coverage.json -m:1
And then add the setting for coverage gutters to pick up this file:
"coverage-gutters.coverageFileNames": [
"coverage.info",
"lcov.info",
"cov.xml",
"coverage.xml",
"jacoco.xml",
"coverage.cobertura.xml"
]
And this worked for me! Might be worth adding this to the docs for when people use multiple test projects. I didn't know that merging coverage results into one file was a thing!
from vscode-coverage-gutters.
A coworker of mine came up with the suggestion to merge the coverage results with the following test runner arguments:
/p:CollectCoverage=true /p:CoverletOutputFormat=lcov%2cjson /p:CoverletOutput=../CoverageResults/ /p:MergeWith=../CoverageResults/coverage.json -m:1
And then add the setting for coverage gutters to pick up this file:
"coverage-gutters.coverageFileNames": [ "coverage.info", "lcov.info", "cov.xml", "coverage.xml", "jacoco.xml", "coverage.cobertura.xml" ]
And this worked for me! Might be worth adding this to the docs for when people use multiple test projects. I didn't know that merging coverage results into one file was a thing!
Excellent, thanks for finding that fix! Definitely we should add that to the readme / docs as folks with larger projects probably run into this all the time.
from vscode-coverage-gutters.
A coworker of mine came up with the suggestion to merge the coverage results with the following test runner arguments:
/p:CollectCoverage=true /p:CoverletOutputFormat=lcov%2cjson /p:CoverletOutput=../CoverageResults/ /p:MergeWith=../CoverageResults/coverage.json -m:1
And then add the setting for coverage gutters to pick up this file:
"coverage-gutters.coverageFileNames": [ "coverage.info", "lcov.info", "cov.xml", "coverage.xml", "jacoco.xml", "coverage.cobertura.xml" ]
And this worked for me! Might be worth adding this to the docs for when people use multiple test projects. I didn't know that merging coverage results into one file was a thing!
what is the -m:1
for?
from vscode-coverage-gutters.
what is the
-m:1
for?
Probably related to the merging and keeping things in sequential order (based on the docs I found below).
from vscode-coverage-gutters.
Related Issues (20)
- Extension settings do not have the scope property defined HOT 3
- refactoring if clause caused extension to crash HOT 3
- update CHANGELOG.md to make changes extension-visible
- Java example pom issues and failure in mvn install HOT 2
- Cannot seem to watch files outside of VS Code workspace directory HOT 2
- Improve visibility of covered lines HOT 4
- Add support for remote coverage files HOT 3
- Support coverage reports with multiple sources HOT 2
- behavior change suggestion/rfc: statusbar should report `Math.floor` instead of `Math.round` HOT 1
- `Illegal argument: line must be non-negative` when any `detail.line` is 0 HOT 1
- Where does the watcher look for the lcov.info file? HOT 2
- Coverage information fails to render when branch coverage is enabled HOT 1
- Update deploy automation action to use v1 of external action
- Cant read coverage data from cobertura-coverage.xml HOT 1
- Don't highlight tested lines HOT 4
- vsix packaging: drop unused folders HOT 1
- cobertura Status Bar Percentage Wrong with C# Workspace HOT 6
- Attempting to parse cobertura.xml fails after converting from visual studio .coverage binary. HOT 2
- settings: resolve configuration settings HOT 1
- [Documentation] Example Java Gradle Project HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-coverage-gutters.