-
Notifications
You must be signed in to change notification settings - Fork 66
Add test cases for editor based extensions scanning #542
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #542 +/- ##
========================================
+ Coverage 8.13% 8.15% +0.02%
========================================
Files 278 278
Lines 45874 45881 +7
========================================
+ Hits 3732 3742 +10
+ Misses 41866 41864 -2
+ Partials 276 275 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds comprehensive tests for scanning VSIX extensions across different editor distributions and tightens path validation.
- Introduces table-driven tests for each supported editor and a combined multi-editor test
- Adds a test for invalid paths to ensure unsupported directories produce an error
- Updates
NewVSIXExtReader
to return an error on unsupported editor paths - Supplies JSON fixtures for VSCode, VSCodium, Cursor, and Windsurf under
pkg/readers/fixtures/vsix
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
pkg/readers/vsix_ext_reader_test.go | Add table-driven tests for single/multiple editors and invalid path |
pkg/readers/vsix_ext_reader.go | Validate input paths in NewVSIXExtReader , error on unsupported path |
pkg/readers/fixtures/vsix/.vscode/extensions/extensions.json | Add VSCode extensions fixture |
pkg/readers/fixtures/vsix/.vscode-oss/extensions/extensions.json | Add VSCodium extensions fixture |
pkg/readers/fixtures/vsix/.cursor/extensions/extensions.json | Add Cursor extensions fixture |
pkg/readers/fixtures/vsix/.windsurf/extensions/extensions.json | Add Windsurf extensions fixture |
Comments suppressed due to low confidence (3)
pkg/readers/vsix_ext_reader_test.go:19
- [nitpick] The test function name uses "VSCodeExtReader" but the reader is named "VSIXExtReader"; consider renaming it to "TestVSIXExtReaderForAllEditors" for consistency.
func TestVSCodeExtReaderForAllEditors(t *testing.T) {
pkg/readers/vsix_ext_reader_test.go:128
- Consider asserting on the specific error message with something like
assert.Contains(t, err.Error(), "unsupported editor path")
to verify the correct error is returned.
assert.Error(t, err)
Please share your thoughts on this: #540 (comment) |
@Sahilb315 LGTM |
Fixes #540