Skip to content

Add unit tests for config models, defaults/validation, camera identity mapping#93

Open
kmatzen wants to merge 4 commits into
mainfrom
claude/github-test-coverage-aabaum
Open

Add unit tests for config models, defaults/validation, camera identity mapping#93
kmatzen wants to merge 4 commits into
mainfrom
claude/github-test-coverage-aabaum

Conversation

@kmatzen

@kmatzen kmatzen commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add ConfigurationUtilsTests.swift covering DefaultConfigurations preset values, fpsDescription, and ConfigValidation (including hasSettingsMismatch field-diff, shutter-exclusion, and encoding-skip behavior)
  • Add CameraConfigModelsTests.swift covering GoProSettingsData JSON round-trips / GoProSettings conversion and CameraConfig init variants + Codable round-trip
  • Add CameraIdentityManagerTests.swift covering CameraIdentityManager name storage/fallback and CameraSerialResolver UUID mapping
  • Fix CI (build.yml) to run the full FacettTests bundle instead of an explicit per-class -only-testing allowlist, so newly added test classes (including these) actually execute instead of being silently skipped

Test plan

  • New test files picked up automatically via Xcode's file-system-synchronized groups (no project.pbxproj changes needed)
  • CI (macos-15 runner) builds and runs FacettTests on this PR — verify it's green

Generated by Claude Code

claude added 3 commits July 21, 2026 14:22
…ntity mapping

Covers previously-untested pure-logic modules: CameraConfig/GoProSettingsData
Codable round-trips, DefaultConfigurations preset values, ConfigValidation
(including hasSettingsMismatch), and CameraIdentityManager/CameraSerialResolver
name and UUID persistence.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0162LgiY7AhBXZjExzafhAp5
The explicit -only-testing list silently skipped any newly added test
class (including the ones just added), so new tests weren't actually
exercised by CI until someone remembered to list them by name.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0162LgiY7AhBXZjExzafhAp5
Both ranges were stale relative to the actual value domains used
elsewhere in the app: mode holds raw GoPro camera mode IDs (up to 27,
see CameraSettingDescriptions.modeDescription; FacettApp.swift sets
mode = 12 for video), and lcdBrightness is a 0-100 percentage (see
lcdBrightnessProfileDescription). The stale 0...1 / 0...2 ranges meant
ConfigValidation.validateConfig flagged the app's own Default config
(mode: 12, lcdBrightness: 100) as invalid — caught by the new
ConfigValidationTests added in this PR.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0162LgiY7AhBXZjExzafhAp5
SettingsValidator.ValidRanges is stale for several more fields beyond
mode/lcdBrightness (antiFlicker, rawAudio, hindsight, whiteBalance, ...),
several of which are sparse non-contiguous ID sets that a ClosedRange
can't represent correctly regardless of bounds. That's a larger,
separate fix - tracked in #94. Narrow this test to check validateConfig's
plumbing (isValid matches errors.isEmpty) without asserting the current,
false invariant that defaults pass validation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0162LgiY7AhBXZjExzafhAp5
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