summaryrefslogtreecommitdiff
path: root/internal/cli/cli_test.go
AgeCommit message (Collapse)Author
2026-04-14fix: shadowing, version.Tag, prealloc LoadRecords (ask 54)Paul Buetow
- CreateKey: avoid shadowing named return err on rand.Read - daemon Run: rename slog logger to slogLog vs stdlib log package - version: rename Version to Tag to avoid version.Version stutter - LoadRecords: COUNT(*) then make slice with capacity Made-with: Cursor
2026-04-14test: microservice coverage for task 63Paul Buetow
Add table-driven HTTP and unit tests for report (all formats, negatives), upload/auth boundaries, upload helpers, readiness, Run and logging. Extend authkeys tests for Close, CreateKey validation, and post-close errors. Add CLI tests for defaultListenFromEnv and create-client-key with -auth-db only. Add mage CoverMicroservice for local/CI-style coverage measurement. Use context.Background and os.Chdir for Go 1.21-compatible tests. Made-with: Cursor
2026-04-14task 13: upload API keys in SQLite, Bearer auth, create-client-key CLIPaul Buetow
- Add internal/authkeys with SHA-256 hashed tokens and KeyCount gate - PUT /upload/{host}/{kind} for uptimed files; auth when any key exists - Daemon -auth-db and Config.AuthDB; plain HTTP unchanged - CLI: goprecords --create-client-key HOSTNAME (-stats-dir|-auth-db) Made-with: Cursor
2026-04-14test(x2): codify CLI backward-compatibility contractPaul Buetow
- Add internal/cli tests for stable entry points: -version/--version, file-based report (-stats-dir), import/query, test subcommand, -daemon/--daemon validation, and subcommand recognition. - Assert RegisterReportFlags keeps required flag names and defaults (CLI/HTTP). - Run integration import/export against a temp SQLite file instead of fixtures/test_import.db to avoid flaky readonly errors under parallel tests. Made-with: Cursor