Testing and quality
Current test surface, verification commands, coverage gaps, quality rules, and the manual QA checklist Kumo expects before a release.
Current Tests
The first test suite covers:
- Runtime config generation.
- Core state persistence.
- System proxy command construction in dry-run mode.
- Mihomo controller response mapping with mocked URL loading.
- Backup export/import round trips.
- Service request signing.
- CLI argument parsing, JSON envelope stability, color/log rendering rules, and npm-style help behavior.
These tests target KumoCoreKit because that layer carries the most important shared behavior.
Verification Commands
Use:
swift build --product kumo
swift test
.build/debug/kumo --help
.build/debug/kumo status --json
.build/debug/kumo skills install --agent codex --scope global --dry-run --jsonDo not start a development server. This project is a Swift package, not a web app.
For user-facing release checks, prefer the bundled helper at
Kumo.app/Contents/Helpers/kumo and the /usr/local/bin/kumo symlink over
swift run kumo.
Test Strategy
Prioritize tests that do not mutate real system state:
- Use temporary application support directories.
- Use dry-run for system proxy commands.
- Mock controller responses before testing live Mihomo APIs.
- Avoid tests that require a real network subscription.
Areas That Need More Coverage
- Profile import and remote refresh errors.
- Missing core path errors.
- UI store behavior.
- Future Unix socket transport.
- Exact system proxy restore from snapshots.
- App update manifest and checksum flows.
Quality Rules
- Keep
KumoCoreKitindependent from SwiftUI. - Keep command execution isolated.
- Use explicit errors instead of generic failures.
- Keep advanced features behind advanced UI.
- Prefer small files grouped by domain responsibility.
Manual QA Checklist
kumo status --jsonreturns valid JSON.kumo --help,kumo -l,kumo help json, andkumo completion zshreturn npm-style discoverability output.kumo status --color nevercontains no ANSI escapes, andkumo status --jsonremains plain JSON even when--color alwaysis supplied.kumo status --silentsucceeds without successful text output.kumo doctor --timingwrites timing diagnostics without polluting JSON output.kumo logs cli --limit 5andkumo logs clean --dry-run --jsonoperate on CLI debug logs without touching runtime logs.- Missing Mihomo core shows a clear error.
- Empty profile still generates a safe direct config.
- System proxy dry-run prints the expected commands.
- SwiftUI window opens with Overview selected.
- Settings opens with Cmd+,.
- Inspect search fields remain available when a query returns no matches.
- Core runtime and System Proxy settings only commit after the user applies staged edits.
- TUN helper uninstall asks for confirmation before removing the service.
- Menu bar status item exposes start, stop, mode switching, refresh, profiles, proxy groups, and system proxy controls.
- App updates check the default GitHub Releases feed when no manifest override is set.
- App update DMG downloads fail closed on SHA-256 mismatch and report a clear error when the current app location is not writable.
kumo doctor --jsonreports status, profile, and core candidate information.kumo backup export <path> --jsoncreates a manifest-backed backup directory.kumo substore status --jsonreports enabled state, frontend/backend runtime state, resource version, and local URL without launching a dev server.