Skip to content

Conversation

Sahilb315
Copy link
Contributor

Fixes #540

@Sahilb315 Sahilb315 requested a review from Copilot July 17, 2025 15:54
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 8.15%. Comparing base (06988f9) to head (94c044a).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@Copilot Copilot AI left a 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)

@Sahilb315 Sahilb315 requested review from abhisek and KunalSin9h July 17, 2025 16:01
@Sahilb315
Copy link
Contributor Author

Please share your thoughts on this: #540 (comment)
Currently went with fail fast option, we can switch to skip the invalid paths

@abhisek
Copy link
Member

abhisek commented Jul 18, 2025

@Sahilb315 LGTM

@Sahilb315 Sahilb315 merged commit 075627f into main Jul 18, 2025
11 checks passed
@Sahilb315 Sahilb315 deleted the fix/#540-test-cases-editor-extensions branch July 18, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add basic test cases for each supported editor for reading extensions
2 participants