test(RHIDP-14570): add intent-based CLI unit gaps and e2e scaffold - #218
Open
HusneShabbir wants to merge 7 commits into
Open
HusneShabbir wants to merge 7 commits into
HusneShabbir wants to merge 7 commits into
Conversation
Fill search/api unit coverage, expand catalog/template command tests, and add help/error contract e2e that skips live RHDH unless configured. Co-authored-by: Cursor <cursoragent@cursor.com>
Use describe.skip for optional live RHDH e2e to satisfy jest/no-standalone-expect, collapse duplicated help/error and command cases to cut Sonar duplication, and keep unique failure coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise real commander/helpers/format paths with client mocked so catalog/api/search/docs/template cover integration ACs without live RHDH. Slim overlapping unit happy-path tests to validation-only cases. Co-authored-by: Cursor <cursoragent@cursor.com>
Format intent-commands.integration.test.ts for CI prettier:check, fold missing get-spec.definition coverage into the mocked integration suite, and remove the overlapping api.test.ts. Co-authored-by: Cursor <cursoragent@cursor.com>
yangcao77
reviewed
Sep 23, 2026
yangcao77
left a comment
Contributor
There was a problem hiding this comment.
the changes generally looks good.
recommand to introduce more tests for more coverage, i.e. --instance switch, catalog validate/register/unregister and docs list/get integration paths remain gaps.
Address review feedback: assert --instance forwarding, catalog validate/register/unregister action wiring, and docs list/get techdocs-mcp-extras integration paths with a mocked client. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
|
Thanks @yangcao77 — addressed in the latest commit:
|
Fold --instance into existing catalog/search integration cases and remove docs unit tests already covered by mocked client integration. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds automated coverage for intent-based CLI commands (RHIDP-14570) without requiring a live RHDH instance for CI.
Unit tests — validation and error-path gaps for catalog, search, and template commands (required inputs, bad flags, etc.).
Mocked-client integration suite —
src/commands/intent-based-actions/intent-commands.integration.test.tsruns real Commander wiring, helpers, formatters, and error handling; only./clientis mocked (no network, no live RHDH):--instance), get, validate (--entity/--entity-file), register, unregisterspec.definition)--instance)techdocs; list; get (techdocs-mcp-extras, incl. merged unresolved-entity cases)Offline e2e scaffold —
e2e-tests/intent-based-cli.test.tschecks process contracts (--help, invalid usage, empty-dir standalone). Optional livecatalog listwhenRHDH_CLI_E2E_URLis set (auth must already be configured).Redundancy / review cleanup (latest:
1183480):api.test.ts(covered by integration).--instanceintegration cases into catalog list + search.jest/no-standalone-expect, Prettier, Sonar duplication trims.Review (@yangcao77) —
--instance, catalog validate/register/unregister, and docs list/get are covered in the mocked integration suite above (--instanceexercised on catalog list and search, not as a separate-only test).Out of scope / follow-up — Full live-RHDH e2e for epic acceptance criteria (install → auth → query across catalog/api/search/docs/template) remains optional via
RHDH_CLI_E2E_URLor a follow-up ticket.Jira: RHIDP-14570 · Epic: RHIDP-14254 · Plan: RHDHPLAN-1131
Test plan
yarn test --watchAll=false --coverage=falseundersrc/commands/intent-based-actions/(unit + mocked integration)yarn test:e2e --testPathPattern=intent-based-cli(offline help/error/empty-dir; live RHDH skipped unlessRHDH_CLI_E2E_URL)yarn prettier:check/yarn lint:checkRHDH_CLI_E2E_URL+ configured auth, confirm livecatalog list --output json --kind Component