Notes on the test suite added during development of glean-code-cli. See Running tests for the user-facing instructions on how to run the tests.
All 604 tests pass. Here's what was added across the development passes:
tests/test_commands_extended.py (155 new tests) — covers all previously untested commands:
/status,/clear,/help/datasources.list(all flag combinations),/datasources.status,/indexing.rotate-token/autocomplete,/recommendations,/feedback,/entities.list/pins.delete,/collections.delete/shortcuts.list,/shortcuts.get,/shortcuts.create,/shortcuts.update,/shortcuts.delete(full flag coverage)/answers.list,/answers.get,/answers.create,/answers.update,/answers.delete(int ID validation, arg passing)/summarize(by URL, by ID, query flag)/verification.list,/verification.verify,/verification.remind(flag passthrough, defaults)/messages.get,/activity.report,/insights(CSV export, all flags)/scaffoldwith--outputflag, cancellation paths_fmt_ts,_render_insights,_export_insights_csv,_print_datasource_status,Session.refresh_client
tests/test_client_extended.py (31 new tests) — covers all new client methods and mock responses:
- Mock responses for all 19 new endpoints (
/unpin,/listshortcuts,/listanswers,/summarize,/insights, etc.) GleanClientmethod bodies: correct paths, partial updates, optional fields, body construction
tests/test_indexing_walk.py (25 new tests) — covers the --path indexing helpers and command flow:
path_to_id,filename_to_title,mime_for_path— slug, title, and extension detectionwalk_files— default include/exclude behaviour,node_modules/.git/.DS_Storefiltering,--max-bytesskip, single-file root, missing-path errors, custom--includeoverridesfile_to_document— Markdown/HTML body shape, view-URL prefix override, unsupported-extension rejection/index.document --path— synthesizes aDocumentDefinition, dry-run skips the API, directory-passed errors, missing-permissions errors, mutex with--from-file, mutex of--publicand--acl-from-file/index.bulk-documents --path— folder walk produces a pagedBulkIndexDocumentsRequest,--includefiltering, dry-run, backward compat with--from-file