Skip to content

test: add regression coverage for recent merges and identifier injection#399

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-03c8
Closed

test: add regression coverage for recent merges and identifier injection#399
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-03c8

Conversation

@cursor

@cursor cursor Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds focused regression tests for recently merged production changes where coverage was thin or missing.

Risky behavior now covered

harness_schema nested definition lookup (PR #368)

  • Resolves bare wrapper definitions when they are grouping objects, not schema nodes
  • Prefers nested schema-node matches over shallow wrappers sharing the same name

Environment identifier injection (PR #328 follow-on)

  • buildBodyNormalized injects environment_id after unwrapping environment: YAML bodies
  • Rejects conflicting identifiers between input and body
  • harness_update for environment sends unwrapped bodies with injected identifier to the API

Log download URL rewrite (PR #358)

  • resolveLogDownloadUrl rewrites Harness CDN hostnames for self-managed installs (without fetching blob content)

Semantic layer kg_type list/get (recent KG merges)

  • List extractor projects compact items across categories, truncates descriptions, skips types without ids
  • object_kind filter is passed as { filter: { objectKind: [...] } } in the request body
  • kg_type get surfaces DCS enrichment metadata on relationship_type responses

Diagnose requested-step download URLs (PR #358)

  • requested_step_log returns download_url (not inline log content) when return_download_url: true

Test files added/updated

  • tests/tools/harness-schema-tool.test.ts
  • tests/tools/tool-handlers.test.ts
  • tests/utils/body-normalizer.test.ts
  • tests/utils/log-resolver.test.ts
  • tests/registry/knowledge-graph.test.ts
  • tests/tools/diagnose/pipeline.test.ts

Why these tests reduce regression risk

These paths sit on high-blast-radius utilities (body-normalizer, log-resolver) and agent-facing contracts (harness_schema, harness_update, harness_diagnose, kg_type). Failures would silently send wrong request shapes, leak internal schema wrappers, or return unusable log URLs on self-managed clusters — all of which are hard to catch without contract-level tests.

Validation

pnpm test tests/utils/log-resolver.test.ts tests/tools/diagnose/pipeline.test.ts tests/registry/knowledge-graph.test.ts tests/tools/harness-schema-tool.test.ts tests/tools/tool-handlers.test.ts tests/utils/body-normalizer.test.ts

311 tests passed.

Open in Web View Automation 

cursoragent and others added 2 commits June 24, 2026 10:07
Add regression tests for harness_schema recursive definition lookup when
only a non-schema-node wrapper exists, and when a nested schema node must
win over a wrapper with the same name. Extend body-normalizer and
harness_update coverage for environment YAML updates with injectIdentifier
after unwrapKey.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
… URLs

Add regression tests for resolveLogDownloadUrl hostname rewriting on
self-managed installs, kg_type list projection and object_kind filtering,
relationship_type DCS enrichment on kg_type get, and requested_step_log
download URLs when return_download_url is true.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@thisrohangupta

Copy link
Copy Markdown
Collaborator

Closing as stale: merge conflicts with main and work superseded by merged PRs (#447, #446, #449, #469, #440, #398, etc.) or duplicate agent-generated attempts. Reopen from a fresh branch if still needed.

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.

3 participants