-
Notifications
You must be signed in to change notification settings - Fork 22
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
Mechanism to watch & dynamically reload coverage results #43
Comments
I don't think this needs to be built-in functionality in the plugin, just want to make the plugin mechanics compatible with a workflow like this, thinking of those slick toolchains that automatically rerun tests when you save changes to a source file. As a very hacky workaround, you could watch the file from outside vim and inject a ls .coverage | entr vim --servername GVIM --remote-expr 'coverage#Show(1)' but that's very manual and |
Are you envisioning something as simple as
It seems like then we could work on making it easier for providers to watch/poll for updates (perhaps with a new This would leave the tasks of watching coverage data and merging reports to the providers, which I think makes sense, because otherwise we'd have to give the main plugin knowledge of provider data and do a bit of reorganization. |
Yep, that should basically do the trick! It should probably identify which provider it's providing for. The code for generating reports from e.g. an lcov file should live in the coverage plugin, I'd think. The plugin could just have an assortment of public helpers available for that, such as a call coverage#UpdateCoverage('gcov', {'lcov_filename': '/some/path/coverage.dat'}) And then the contract of what metadata to pass could vary per provider as needed. |
👍 cool, I think we're on the same page then. Since the current provider schema is
provider.UpdateCoverage({metadata})
provider.UpdateCoverageAsync({metadata})
coverage#UpdateCoverage({provider_name}, {metadata}) The provider-specific metadata is especially nice for providers that source coverage from RPCs instead of files |
Perfect, looks good to me!
My thoughts exactly! Could take a URL or a blob of already-fetched data, just whatever tends to make sense for the given provider. |
After doing
:CoverageShow
, could you have vim watch whatever .coverage file it loaded results from and immediately notice and reload results if that changes? For example, if you runnosetests --with-coverage
outside of vim and that generates new coverage results for the current file, could the plugin immediately discard the stale results and show the fresh ones?Note we already have #27 to have a manual way to reload coverage, like
:CoverageShow!
.The text was updated successfully, but these errors were encountered: