Skip to content

test: cover top high-fanin untested helpers (84 Python + 13 Node tests)#3

Merged
smochan merged 7 commits into
mainfrom
test/c3-helper-coverage
Apr 27, 2026
Merged

test: cover top high-fanin untested helpers (84 Python + 13 Node tests)#3
smochan merged 7 commits into
mainfrom
test/c3-helper-coverage

Conversation

@smochan

@smochan smochan commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

Direct unit tests for ~16 high-fanin helpers across viz/_style, roles, parsers/typescript, mcp_server, embed/store, viz/diagrams, viz/hld, plus JS helpers.

Tests added

  • 84 new Python tests across 7 new test files
  • 13 new Node tests (formatQn + linkKey)
  • Total: 333 + 84 = 417 Python; 73 Node

Notes

@smochan smochan merged commit d6d5f1d into main Apr 27, 2026
3 checks passed
smochan added a commit that referenced this pull request May 30, 2026
FastAPI Pydantic request-body models were being flagged dead because
the only reference to them came through a handler's parameter type
annotation, which the Python parser didn't trace.

The parser now walks each function's parameter `type` strings and the
return-type string, regex-extracts capitalized identifiers, drops
typing-scaffolding (`Optional`, `Annotated`, `Union`, ...) and FastAPI
dependency markers (`Body`, `Depends`, ...), and emits one
`CALLS` edge with `dst="unresolved::<TypeName>"` and
`metadata.via == "annotation"` per surviving name. The existing
resolver rewrites these to real `CLASS` ids when the type is in-repo,
which closes the loop for dead-code detection.

Framework-agnostic: every function with type annotations benefits, not
just route handlers. The change reuses `EdgeKind.CALLS` (rather than
introducing a new `REFERENCES` kind) because `CALLS` already flows
through the resolver and the reference-kind whitelist used by
dead-code, and Pydantic-body validation IS effectively a runtime call
into the model class.

v0.1.2 backlog item #3.
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