test(upgrade): fix GGA backup test for Windows paths#916
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo test files are updated to ensure platform-correct GGA path handling. GGA component tests now set the ChangesGGA Path Helpers and Environment Setup in Tests
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Alan-TheGentleman
left a comment
There was a problem hiding this comment.
Good catch on the platform-specific GGA paths, but this test still has an isolation problem on Windows.
gga.ConfigPath(homeDir) can use %APPDATA% when it is set, which means the test may write to the real user profile instead of the temp home. Tests cannot mutate a developer's actual GGA config location, even accidentally.
Please control APPDATA in the test, or use a helper/seam that guarantees the generated path stays inside t.TempDir() on Windows.
|
Hi @Alan-TheGentleman, I've isolated the tests on Windows:
Ready for re-review! |
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:
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
Testing
Summary by CodeRabbit
Release Notes
APPDATAto ensure consistent behavior across systems.