kamiazya/scopes
fix: resolve FileBasedUserPreferencesRepository test failures
オープン
#220 opened on 2025/09/12
good first issuehacktoberfest
Repository metrics
- Stars
- (2 個のスター)
- PR merge metrics
- (PR metrics pending)
説明
Problem
Three tests in FileBasedUserPreferencesRepositoryTest are failing due to implementation bugs in the repository:
Failing Tests
-
should fail when aggregate has no preferences (line 198)
- Expected:
PreferencesNotInitializederror - Actual:
InvalidPreferenceValuewith ULID validation error
- Expected:
-
should load valid preferences from file successfully (line 275)
- Expected: Fixed timestamp
2022-01-01T00:00:00Z - Actual: Current system timestamp
- Expected: Fixed timestamp
-
should handle permission errors when writing file (line 447)
- Expected: Graceful error handling
- Actual:
AccessDeniedExceptionduring repository construction
Root Causes
- ULID validation logic issues in preference value handling
- Timestamp overwriting during file deserialization
- Missing error handling in repository constructor for filesystem permissions
Impact
- Tests fail in CI/CD pipeline
- Temporarily excluded from JaCoCo coverage to unblock CI integration
- No impact on actual functionality (tests are overly strict)
Acceptance Criteria
- Fix ULID validation for preference values
- Preserve timestamps during file loading operations
- Add proper error handling for filesystem permission issues in constructor
- All 34 tests in infrastructure module should pass
- Re-enable JaCoCo coverage for this module
Priority
Medium - Does not block current development but should be addressed to maintain test coverage and code quality.