Skip to content

test: cover get_dd_changelog and signal_analytics MCP tools - #39

Open
721AndrewWang wants to merge 1 commit into
iterorganization:mainfrom
721AndrewWang:test/dd-changelog-signal-analytics-upstream
Open

721AndrewWang wants to merge 1 commit into
iterorganization:mainfrom
721AndrewWang:test/dd-changelog-signal-analytics-upstream

Conversation

@721AndrewWang

Copy link
Copy Markdown

Follow-up to #38.

Adds unit tests for two MCP tools that had no test references, get_dd_changelog and signal_analytics. No source changes.

  • tests/tools/test_dd_changelog.py (15 tests): VersionTool.get_dd_changelog parameter contract, result shaping and error path; format_dd_changelog_report header, version-range labels, rows and truncation hint.
  • tests/llm/test_signal_analytics.py (33 tests): group_by validation, routing between the plain query and the CHECKED_WITH join, check_status and error_type filters, parameterisation, error handling and _format_analytics.

All tests run in the default marker tier against a mocked GraphClient, no Neo4j needed.

One test pins a behaviour rather than a decision: unknown filters keys are currently dropped silently while unknown group_by values are rejected. If you would rather have filters error too, I can change the tool and flip that test here.

Verified locally against this branch (upstream main at b0d769b) and against Simon-McIntosh/imas-codex main at 7745119:

uv run pytest tests/tools/test_dd_changelog.py tests/llm/test_signal_analytics.py
48 passed
uv run ruff check . && uv run ruff format --check .

Both tools had no test references. Add mock-backed unit tests that
pin the Cypher parameter contract, query routing, result shaping,
error handling, and markdown formatting. No source changes.

- tests/tools/test_dd_changelog.py: VersionTool.get_dd_changelog and
  format_dd_changelog_report (15 tests)
- tests/llm/test_signal_analytics.py: _signal_analytics, its two query
  shapes, and _format_analytics (33 tests)

The unknown-filter-key test pins the current behaviour (keys are
silently dropped, unlike group_by which is validated) so that a
deliberate change shows up in review.
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