Skip to content

test: cover chaos service discovery list chain and sdPageExtract - #826

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-1b59
Draft

test: cover chaos service discovery list chain and sdPageExtract#826
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-1b59

Conversation

@cursor

@cursor cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Description

Adds regression tests for chaos service-discovery resources shipped in #656 (discovered_namespace, discovered_service, discovered_network_map) and the shared sdPageExtract response helper.

Risky behavior now covered

  • Required filter validationagent_identity and environment_id must be present before any SD list API call; prevents silent malformed requests.
  • Path substitutionagent_identity is encoded into /agents/{agentIdentity}/namespaces|discoveredservices|networkmaps.
  • Query param mapping — SD uses limit (not size) and environmentIdentifier for environment scoping.
  • Empty-result guidancesdPageExtract attaches troubleshooting _hint text only when items are empty, and reconciles total when pagination under-reports.

Test files added/updated

  • tests/registry/chaos-service-write.test.ts — list dispatch for discovered_namespace, discovered_service, discovered_network_map
  • tests/registry/extractors-chaos.test.tssdPageExtract envelope parsing and hint behavior

Why these tests materially reduce regression risk

The chaos_service create flow depends on the SD agent → namespace → service → network map chain. A regression in required filters, path building, or pagination mapping would break onboarding new services without obvious compile-time failures. These tests lock the request contract that agents follow end-to-end.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (test coverage)

Checklist

  • pnpm test passes (focused: extractors-chaos + chaos-service-write — 31 tests)
  • pnpm typecheck passes
  • pnpm build passes
  • pnpm standards:check passes
  • pnpm docs:check passes (registry/tool counts unchanged)

Coding Standards (registry-driven MCP model)

N/A — test-only change.

Open in Web View Automation 

Add regression tests for chaos PR #656 service-discovery resources:
discovered_namespace, discovered_service, and discovered_network_map list
dispatch (required filters, path substitution, SD limit param mapping).

Also cover sdPageExtract empty-result hints and total reconciliation used
by all four SD list endpoints.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant