Skip to content

Conversation

@TabishB
Copy link
Contributor

@TabishB TabishB commented Jan 10, 2026

Summary

Skip two additional Windows-specific tests that were still failing after #464.

Changes

  • fish-installer: skip uninstall permission test (chmod on directory)
  • powershell-installer: skip "skip configuration when script line exists" test (Windows has dual profile paths, so the second profile gets configured)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Improved cross-platform test reliability for shell completion installers: fish and PowerShell tests are now conditionally skipped on Windows to avoid platform-specific permission/profile differences.
    • Updated Bash-related tests to simulate blocking-file scenarios that trigger directory/write errors, yielding consistent ENOTDIR/permission behavior across platforms and reducing false failures.

✏️ Tip: You can customize this high-level summary in your review settings.

- fish-installer: skip uninstall permission test (chmod on directory)
- powershell-installer: skip "skip configuration when script line exists"
  test (Windows has dual profile paths so the second profile gets configured)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 10, 2026

📝 Walkthrough

Walkthrough

Tests updated to avoid Windows-specific failures: fish and PowerShell tests are conditionally skipped on Windows; bash tests now simulate failures by creating a blocking file to trigger ENOTDIR/permission errors instead of using invalid home paths. No production code changes.

Changes

Cohort / File(s) Summary
Platform-Conditional Test Skipping
test/core/completions/installers/fish-installer.test.ts, test/core/completions/installers/powershell-installer.test.ts
Added it.skipIf(process.platform === 'win32') to selectively skip specific tests on Windows; explanatory comments added about Windows ACL/chained-profile behavior.
Bash installer failure simulation
test/core/completions/installers/bash-installer.test.ts
Replaced tests that used invalid home directories with tests that create a temporary blocking file inside the test home and instantiate BashInstaller against that file path to produce ENOTDIR/permission errors during install/configure flows.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰
I nibble on tests with a curious hop,
Skipping on Windows where permissions flop,
I tuck a small file where a folder should be,
And watch the tests fail as they ought to, with glee —
Hooray for reliable, cross-platform harmony!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: skip additional Windows-specific tests' directly aligns with the PR's primary objective of skipping Windows-specific tests in fish-installer and powershell-installer that were failing after PR #464.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

Instead of platform-specific invalid paths (Z:\ or /root), create a
temporary file and use it as homeDir. This guarantees deterministic
ENOTDIR failures when trying to create subdirectories on all platforms.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
test/core/completions/installers/bash-installer.test.ts (2)

378-388: Consider updating test name to reflect ENOTDIR scenario.

The implementation correctly uses the blocking file pattern for cross-platform testing. However, the test name says "write permission errors" when it's actually testing ENOTDIR errors (attempting to write to a path where a parent component is a file, not a directory). The comments correctly describe the behavior.

💡 Suggested test name update
-    it('should handle write permission errors gracefully', async () => {
+    it('should handle ENOTDIR errors gracefully', async () => {
       // Create a temporary file and use its path as homeDir
       // This guarantees ENOTDIR when trying to write .bashrc (cross-platform)

465-470: Consider using blocking file approach for cross-platform consistency.

This test still uses the Unix-specific path /root/invalid/path, which is inconsistent with the PR's goal of making error tests cross-platform using the ENOTDIR approach (as applied in lines 141-152 and 378-388).

♻️ Align with cross-platform ENOTDIR pattern
     it('should handle permission errors gracefully', async () => {
-      const invalidInstaller = new BashInstaller('/root/invalid/path');
+      // Create a temporary file and use its path as homeDir
+      // This guarantees ENOTDIR when trying to access .bashrc (cross-platform)
+      const blockingFile = path.join(testHomeDir, 'blocking-file-remove');
+      await fs.writeFile(blockingFile, 'blocking content');
+      const invalidInstaller = new BashInstaller(blockingFile);
       const result = await invalidInstaller.removeBashrcConfig();
 
       expect(result).toBe(true);
     });
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11c50ab and 92c6f1f.

📒 Files selected for processing (1)
  • test/core/completions/installers/bash-installer.test.ts
🔇 Additional comments (1)
test/core/completions/installers/bash-installer.test.ts (1)

141-152: LGTM! Cross-platform error handling approach is sound.

The blocking file technique reliably triggers ENOTDIR errors across all platforms when the installer attempts to create subdirectories under a file path. This is a solid improvement over platform-specific invalid paths.

@TabishB TabishB merged commit 504c93b into main Jan 10, 2026
7 checks passed
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.

2 participants