2.1 KiB
Knowledge One View CLI Tests
This folder keeps the skill tests intentionally small and executable.
The suite covers three offline themes:
functions.test.mjschecks local functions and output contracts.lib-contracts.test.mjschecks shared CLI, auth, runtime-path, and output helpers.sales-prompts.test.mjschecks whether common sales prompts map to quick, documented CLI commands for Oracle DV, and verifies high-risk render-only CLI contracts such as mode conflicts, scope aliases, and query source inference.
The tests read SKILL.md and references/*.md as the source of truth. They should not keep a parallel copy of long parameter lists, aliases, defaults, or week mappings.
Run offline tests:
node tests/run.mjs
Run live backend checks:
KNOWLEDGE_ONE_VIEW_LIVE=1 \
ORACLE_SI_RUNTIME_HOME=/path/to/workspace/knowledge-one-view-cli/runtime \
node tests/run.mjs
Offline mode does not call Oracle DV. Live mode starts with a no-cache session-context read, then runs prompt-sized backend checks. Prompts that should be org-wide commercial reads assert the primary source from references/api-map.md, reject fallback to DV - SE Team, and use larger live limits when row volume is part of the expected behavior.
Offline coverage should favor stable behavior over exhaustive combinations. The highest-value cases are date-window resolution, manager/resource normalization, scope disclosure, query source selection, output money formatting, API row metrics, and early CLI validation before any backend call.
The focused-intent capability matrix protects the intended small surface area: owner, owner-manager, and resource close-window asks get first-class intents, while multi-axis combinations and SR country/owner asks stay out of scope until a real use case justifies them.
Every test invocation of fetch-sales-intelligence.mjs is forced through --no-cache.
When ORACLE_SI_RUNTIME_HOME is set, the tests copy auth-state.json and session-meta.json into a temporary runtime first, so live checks do not rewrite the source runtime. Set ORACLE_SI_TEST_RUNTIME_HOME when you intentionally want to provide a writable test runtime.