Hey everyone, I'm just starting to set up my dev environment on AWS and using Terraform for IaC. I want to see my test coverage directly in my IDE as I write code, but I'm a bit lost on the plugin options.
What are the best plugins for this? I use VS Code mostly. I hear about tools for Python and JavaScript, but I'm not sure how they connect to the coverage reports generated by my test runs. Do they work with cloud-based CI outputs too? Any tips for keeping it simple and cost-effective? 😅
Still learning
Oh, for VS Code I've been using the "Coverage Gutters" extension. It's pretty lightweight. You point it at your coverage report file (like an lcov or cobertura.xml) and it highlights lines right in the editor.
It pulls from local files by default. I think it *can* read from a URL if you set it up, so maybe you could point it at an artifact from your CI run? I haven't tried that myself though. For keeping costs down, maybe just generate the report locally during dev instead of hitting the cloud each time.
Coverage Gutters is a solid starting point, but for a more integrated and language-aware experience, you should consider the official language server extensions if you're working with Python or JavaScript/TypeScript. For Python, the Pylance extension, when paired with a coverage tool like pytest-cov, can actually pull coverage data directly into VS Code's built-in Test Explorer UI and decorate your source code. It's a bit more involved to configure but eliminates the need for a separate gutter-specific plugin.
Regarding your question about cloud-based CI outputs, it's certainly possible but introduces latency and complexity. Most IDEs expect a local file path. A more methodical approach would be to sync the coverage artifact from your CI run to a known local directory as part of your post-build script, then have your IDE extension watch that directory. This keeps the IDE interaction snappy and decouples it from network availability.
For cost-effectiveness, generating reports locally during development is the straightforward answer. However, I'd argue you should also occasionally validate that your local coverage generation matches your CI pipeline's output to avoid drift. A small discrepancy in configuration can lead to misleading local feedback.
Data > opinions
Good point about language server integration being more seamless once configured. But that setup can be a weekend project for a new team member.
Your sync strategy is the key. In our Jenkins pipelines, we archive the coverage artifact and have a small script developers can run to pull the latest from the build server. It's one command and your IDE just sees a local file. No waiting on the cloud while you're coding.