Skip to content
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

Add helper documentation to aid people using preview coverage report #324

Open
1 task
leogott opened this issue Jun 26, 2021 · 4 comments
Open
1 task

Comments

@leogott
Copy link

leogott commented Jun 26, 2021

Description

Improve documentation and extension warnings to give hints about the problem and how to fix it.

Work

  • Edit preview error on no file found to give a better warning or hint around how to modify the glob

Triage

See the comment below
#324 (comment)

Original Ticket Title

Preview Coverage Report does not work with the defaults while Show Gutter Coverage does

Describe the bug
Possibly a fix in documentation/ helpful pop-ups, but:
Without changing the (quite crowded) settings, Add/Remove Watch seems to be working, and coverage is displayed in the gutter properly.
But I can't get preview coverage report to do anything beside throwing pop-ups at me.

To Reproduce
Steps to reproduce the behaviour:

  1. Run 'Coverage Gutters: Preview Coverage Report'

  2. This entry field opens. Try to enter the name of the coverage-report file, the path to it, anything.
    grafik

  3. Click somewhere else. Get these messages.
    grafik

Expected behaviour
I expected the entry field to contain suggestions or accept the relative path to a file, (or to warn me that something is misconfigured).

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Win 10 Pro 64x with WSL ubuntu (using Docker bindings)
  • Extension Version 2.7.4
  • VSCode Version 1.57.1

Additional context
The project uses the jacoco maven plugin to report coverage.

@leogott leogott changed the title Preview Coverage Report does not appear to be functional Preview Coverage Report does not work with the defaults while Show Gutter Coverage does Jun 26, 2021
@ryanluker
Copy link
Owner

@leogott Thanks for submitting an issue!
We have an example project that is used for testing the "preview" coverage functionality.
https://github.com/ryanluker/vscode-coverage-gutters/blob/master/example/node/index.html

If you load the above node example you should be able to use the preview coverage report command and see a list of file options to use. Currently the preview functionality is only setup to look for a couple files based on a glob pattern (it hasn't been improved or touched in a while development wise sadly) and you can find the default here if you haven't seen this already.
https://github.com/ryanluker/vscode-coverage-gutters/blob/master/package.json#L146-L150

If it would be possible to loosen the restriction of the index.html being in the coverage folder I would but I don't think it would as useful given there might be a ton of index.html's in peoples projects that are not related to a coverage report.

One area we could improve on is making changes to the readme explaining how to modify this (you eluded to this in your ticket around improving discoverability) but I believe the preview is one of the less used features of the extension so not much time has been spent on maintaining or creating documentation.

@ryanluker ryanluker changed the title Preview Coverage Report does not work with the defaults while Show Gutter Coverage does Add helper documentation to aid people using preview coverage report Jun 27, 2021
@leogott
Copy link
Author

leogott commented Jun 28, 2021

Thank you for the extensive reply!
My use case for the coverage preview is that I have a setup with Windows and WSL, and opening the reports in Firefox isn't trivial.

Yeah after modifying the regexpression to target/site/jacoco/**/index.html the feature worked (mostly) as expected. (the icons are missing and the table looks kinda weird)

Maybe a solution would be for Choose a Coverage Report to preview. to not appear if coverageReportFileName does not match anything, and instead a popup to appear:

Coverage Report not found
No files matched %{coverageReportFileName}.
[Edit setting] (Link to setting coverageReportFileName)

@ryanluker
Copy link
Owner

ryanluker commented Jul 1, 2021

@leogott Good thinking on the improved error front! I will add some of those bits to the main part of the story.

On the icons not loading issue, I have seen this before and sometimes the webview, being set to a strict security mode, wont allow even local relative files to be loaded (icons, css, etc). You can see another ticket for this here #250 (comment) and after the recent work we did for the webview security this might be simpler 🤔 . https://code.visualstudio.com/api/extension-guides/webview#loading-local-content

@ryanluker
Copy link
Owner

Related to #333 / #369 and fixed in #363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants