test: cover chaos service discovery list chain and sdPageExtract - #826
Draft
cursor[bot] wants to merge 1 commit into
Draft
test: cover chaos service discovery list chain and sdPageExtract#826cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
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>
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.
Description
Adds regression tests for chaos service-discovery resources shipped in #656 (
discovered_namespace,discovered_service,discovered_network_map) and the sharedsdPageExtractresponse helper.Risky behavior now covered
agent_identityandenvironment_idmust be present before any SD list API call; prevents silent malformed requests.agent_identityis encoded into/agents/{agentIdentity}/namespaces|discoveredservices|networkmaps.limit(notsize) andenvironmentIdentifierfor environment scoping.sdPageExtractattaches troubleshooting_hinttext only when items are empty, and reconcilestotalwhen pagination under-reports.Test files added/updated
tests/registry/chaos-service-write.test.ts— list dispatch fordiscovered_namespace,discovered_service,discovered_network_maptests/registry/extractors-chaos.test.ts—sdPageExtractenvelope parsing and hint behaviorWhy 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
Checklist
pnpm testpasses (focused: extractors-chaos + chaos-service-write — 31 tests)pnpm typecheckpassespnpm buildpassespnpm standards:checkpassespnpm docs:checkpasses (registry/tool counts unchanged)Coding Standards (registry-driven MCP model)
N/A — test-only change.