Skip to content

test(ide): cover jetbrains generic download, extract, and install helpers - #1555

Draft
skevetter wants to merge 2 commits into
mainfrom
test/ide-jetbrains-coverage
Draft

skevetter wants to merge 2 commits into
mainfrom
test/ide-jetbrains-coverage

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Summary

Adds hermetic unit tests for the logic in pkg/ide/jetbrains/generic.go. Test-only: product code is unchanged. The other ten files in the package are constructors and option tables, so they are not covered here.

Why

generic.go holds the download-URL precedence (VERSION, DOWNLOAD_AMD64, DOWNLOAD_ARM64), the install-path layout, archive extraction (strip level and path-traversal rejection), arch-specific download, and the no-plugins early return. None of these had tests.

Validation

  • go test -race -count=3 ./pkg/ide/jetbrains/...: pass.
  • mise run cli:format: no changes.
  • mise run cli:lint:ci: 0 issues.
  • Break-and-red (run locally, then restored; generic.go byte-identical afterwards):
    • Changed extract.StripLevels(1) to StripLevels(0): TestExtractArchiveStripsTopLevelDirectory fails.
    • Changed the RemoteDev path segment: TestGetDirectoryUnderHome fails.
  • Tests use t.TempDir, httptest, and in-memory tar.gz archives. No network or real $HOME.

CodeRabbit CLI

coderabbit review --agent --committed on 194801c: completed, 0 findings.

Auto-merge

Not eligible for auto-merge until a human marks it ready.

Next

  • Skipped on purpose:
    • GetVolume and getDownloadFolder build container paths with filepath.Join. On Windows that yields backslashes in the mount dst. Asserting the literal would fail on Windows, and fixing it is a product change.
    • installPlugins with plugins: needs Credential (root) to run.
    • Install/OpenGateway: need the real user home and network.
  • Open question: VERSION defaults to latest, which makes DOWNLOAD_* overrides ignored. Not pinned by a test; needs a product decision.

@skevetter skevetter added the test-coverage Unit test coverage (maintenance bot) label Oct 18, 2026
@netlify

netlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 7ebcf1f
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ad51312aae6cba4293673e2

@netlify

netlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 7ebcf1f
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6ad5131206849e348f61d482

@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

size/l test-coverage Unit test coverage (maintenance bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant