全体ロードマップ: https://github.com/yancya/reminder-cli/issues/3(P2-3)
背景
本ツールは日常運用(自動化・reminder-server のバックエンド)に組み込まれており後方互換が最重要だが、現状テストが1本もない。今後の機能追加(--format json の変更系対応、lists サブコマンド等)の前に、リグレッション検知の足場を作る。開発は TDD(t_wada 流)で進める方針。
現状ポインタ
Package.swift — test target なし
Sources/reminder-cli/OutputFormatter.swift(377行)— text/json/pretty-json/yaml の整形。ReminderOutput(Encodable な素の struct)を受けるので EventKit 非依存でテスト可能
Sources/reminder-cli/ReminderStore.swift(706行)— EventKit 依存が集中。日付パース等の純粋ロジックが混在している場合は切り出し対象
Sources/reminder-cli/reminder_cli.swift(382行)— ArgumentParser のコマンド定義
ゴールと受け入れ条件
手順
備考
EventKit 実機アクセス(ReminderStore の CRUD)は CI で権限が取れないため対象外。将来 EKEventStore を protocol で抽象化して fake を注す案は、必要になったら別 issue に切る。
全体ロードマップ: https://github.com/yancya/reminder-cli/issues/3(P2-3)
背景
本ツールは日常運用(自動化・reminder-server のバックエンド)に組み込まれており後方互換が最重要だが、現状テストが1本もない。今後の機能追加(
--format jsonの変更系対応、listsサブコマンド等)の前に、リグレッション検知の足場を作る。開発は TDD(t_wada 流)で進める方針。現状ポインタ
Package.swift— test target なしSources/reminder-cli/OutputFormatter.swift(377行)— text/json/pretty-json/yaml の整形。ReminderOutput(Encodable な素の struct)を受けるので EventKit 非依存でテスト可能Sources/reminder-cli/ReminderStore.swift(706行)— EventKit 依存が集中。日付パース等の純粋ロジックが混在している場合は切り出し対象Sources/reminder-cli/reminder_cli.swift(382行)— ArgumentParser のコマンド定義ゴールと受け入れ条件
swift testがローカルで緑swift build+swift testが回るYYYY-MM-DD/YYYY-MM-DD HH:MM/ 不正入力)swift testを追記手順
Package.swiftに.testTarget(name: "reminder-cliTests", dependencies: ["reminder-cli"])を追加(executable target のままテストできない場合は core ロジックを library target に分離)Tests/reminder-cliTests/を作成し、まず OutputFormatter の JSON 出力テストを1本書いて赤→緑を確認.github/workflows/ci.ymlを新設(release.yml とは別。macos-latest, swift build + swift test)備考
EventKit 実機アクセス(ReminderStore の CRUD)は CI で権限が取れないため対象外。将来 EKEventStore を protocol で抽象化して fake を注す案は、必要になったら別 issue に切る。