-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve non-existing file #7
Comments
@polortiz4 Hey, I need to have a look in details. There is some assumptions on how the file path are specified in the coverage file. Could you send me an extract of a coverage file on a project where you are using that hierarchy? |
Sorry, I just saw you replied to me. I'll try to replicate the issue and send you the file (I've switched systems since last time) |
@elbeshenrique Had a look, that fix is probably going to fix some bugs (UNC paths and similar...) but won't fix the issue here. Have a look at the first screenshot which is an extract from the jacoco file and then you can see the watch on the left with the result how the data is read. (src/main/java could be src/main/java/example/example2/... or shorter, meaning if it is not present the jacoco, I can't see how we can "guess" it) Thanks all for your help. |
try-vscode.zip |
Thanks, that helps a lot. Actually I realised it is a common issue with Jacoco and Java. I had a look at https://github.com/ryanluker/vscode-coverage-gutters and realised they had to do file matching when trying to bind the coverage to the file open in the text editor. They probably realised those file path issues which might exist in different environments. In any case, I implement a similar fix, much simpler and tests are ongoing. I will build a version for you and share it here to be tested when you have time/chance. |
@polortiz4 Sorry for delay, life kept me really busy. I published the extension to the market place with the fix. Could you test and confirm it is fixed? |
Hello! I am facing the same issue. My project structure is: root They are separate projects, I am building a library which is in appLibrary (the one I want to test) and a demoApp which is just going to consume for viewing purposes only. I added flutter-coverage.coverageFilePaths = ["appLibrary/coverage"] in order for the plugin to recognize only test files in appLibrary. But when I take a look on the coverage tree it displays like this: root |
@neirupr Hi, can you send me a zip with a sample project having the same issue? What version do you have? |
Attaching the whole project. Inside it you need to run When you watch the coverage tree you will face the error when you click over any of the source files in that tree. I think it happens because demo project is not located directly in the root but in a subfolder. I think a good solution would be to make the path relative to value specified in "flutter-coverage.coverageFilePaths" in settings.json which you will also find in the root project. |
Hi @neirupr, I will have a look in details, but as a workaround, when you have multiple projects inside your root, create a Workspace and it should work better. I use the workspace to locate folders as of now when you have more than a project in your root. You can start with an empty VSCode window, then, File>Add Folder to Workspace and select demo. Do the same for your second folder which is demo_consumer, then File>Save Workspace As and save your workspace. Try this and let me know if it works for you, until I have a more permanent fix. (Check the zip below, contains your example but with a vscode workspace and in VScode, just do File>Open Workspace from File and select "demo.code-workspace") As I explained before, depending on the test framework, the file path inside the coverage files are not always relative to the project root, so I had to workaround it trying to match files from the workspace to paths on the coverage file. I can't use the coverage path can not be a "reference". |
I had a look, and I'm not sure there is a proper way to do it. The issue here is that you are running your flutter test command from a different "root" than your VSCode workspace "root". @neirupr check my previous suggestion and tell me if that works out for you. |
So I'm enjoying this extension and currently have only one issue with it:
My file structure is
(among other, likely irrelevant, stuff)
Even though koverage correctly identifies the test coverage, when trying to open the source file from the koverage explorer, I can see the extension attempts to open "root/my/package/Thing.java" instead of "root/src/main/java/my/package/Thing.java"
Is there a way to fix this so koverage knows the correct absolute path to my file?
The text was updated successfully, but these errors were encountered: