Skip to content

test(upgrade): fix GGA backup test for Windows paths#916

Open
decode2 wants to merge 1 commit into
Gentleman-Programming:mainfrom
decode2:fix/test-gga-windows-paths
Open

test(upgrade): fix GGA backup test for Windows paths#916
decode2 wants to merge 1 commit into
Gentleman-Programming:mainfrom
decode2:fix/test-gga-windows-paths

Conversation

@decode2

@decode2 decode2 commented Jun 17, 2026

Copy link
Copy Markdown

Summary

Fixes \TestConfigPathsForBackup_GGAExtrasAreIncluded\ which was failing on Windows because it hardcoded Unix-style paths.

Problem

The test created GGA config files at ~/.config/gga/config\ (Unix-style path), but \gga.ConfigPath(homeDir)\ uses platform-specific paths:

  • Windows: %APPDATA%\gga\config\ (e.g., \C:\Users...\AppData\Roaming\gga\config)
  • Unix: ~/.config/gga/config\

This caused the test to fail on Windows because \configPathsForBackup()\ correctly returned the Windows path, but the test expected the Unix path it had created.

Solution

Use \gga.ConfigPath(homeDir)\ and \gga.RuntimePRModePath(homeDir)\ instead of hardcoding paths. This ensures the test creates files at the correct platform-specific locations.

Changes

  • Import \github.com/gentleman-programming/gentle-ai/internal/components/gga\
  • Replace hardcoded paths with \gga.ConfigPath(homeDir)\ and \gga.RuntimePRModePath(homeDir)\

Testing

  • ✅ Test passes on Windows
  • ✅ All other tests in \internal/update/upgrade\ continue to pass

Summary by CodeRabbit

Release Notes

  • Tests
    • Enhanced backup path resolution for GGA components to ensure platform-correct inclusion in backup operations across different systems.

The test was hardcoding Unix-style paths (~/.config/gga/config) but
gga.ConfigPath() uses %APPDATA%\gga\config on Windows. Use the gga
package functions to get platform-correct paths instead of hardcoding.

This ensures the test works correctly on all platforms.
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 79e93122-5b2e-4638-9f7d-aa02f4b408db

📥 Commits

Reviewing files that changed from the base of the PR and between c9e2ad6 and 0740005.

📒 Files selected for processing (1)
  • internal/update/upgrade/executor_test.go

📝 Walkthrough

Walkthrough

A single test file is updated to import internal/components/gga and replace hardcoded dot-path strings with gga.ConfigPath(homeDir) and gga.RuntimePRModePath(homeDir) calls inside TestConfigPathsForBackup_GGAExtrasAreIncluded. No exported signatures are changed.

Changes

GGA Path Helpers in Backup Test

Layer / File(s) Summary
Replace hardcoded GGA paths with helper calls
internal/update/upgrade/executor_test.go
Adds import for internal/components/gga and updates TestConfigPathsForBackup_GGAExtrasAreIncluded to compute expected paths via gga.ConfigPath(homeDir) and gga.RuntimePRModePath(homeDir) instead of literal strings, keeping inclusion assertions intact.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: fixing a GGA backup test to work with Windows-specific paths instead of hardcoded Unix paths.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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.

1 participant