feat(utils): split MCP and plugin requirements, add plugin integration tests#458
feat(utils): split MCP and plugin requirements, add plugin integration tests#458omid-aignostics wants to merge 7 commits intomainfrom
Conversation
…n tests - Refine SHR-UTILS-1: remove plugin references, use Developers actor - Add SHR-UTILS-2 (Plugin System for SDK Extension) with SWR-UTILS-2-1/2/3 - Update SPEC-UTILS-SERVICE with new SWRs and FR-11/12/13 - Add TC-UTILS-PLUGIN-02/03 feature files linked to SWR-UTILS-2-2/3 - Add plugin integration tests for CLI and GUI plugin registration - Extend mcp_dummy_plugin with Typer CLI and BaseNavBuilder artifacts - Fix di_test.py: replace non-existent SPEC-UTILS-DI refs with SPEC-UTILS-SERVICE Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Non-test source files (e.g. dummy plugin modules) live under tests/resources/ and should not be required to follow the *_test.py naming convention. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR refines the utils requirements/specs to separate MCP-server concerns from a new plugin system requirement set, and adds integration test coverage that validates plugin-provided CLI and GUI navigation registration via a dummy plugin fixture.
Changes:
- Split requirements into MCP server (
SHR-UTILS-1) vs plugin system (SHR-UTILS-2+SWR-UTILS-2-*) and updatedSPEC-UTILS-SERVICEto include FR-11/12/13. - Extended the
mcp_dummy_plugintest resource with a Typer CLI and GUI nav builder exports to support plugin integration testing. - Added plugin integration tests plus corresponding BDD feature files; corrected
record_propertyIDs indi_test.py; updated pre-commit exclusions fortests/resources/.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/resources/mcp_dummy_plugin/src/mcp_dummy_plugin/_nav.py | Adds dummy BaseNavBuilder implementation for GUI plugin registration tests. |
| tests/resources/mcp_dummy_plugin/src/mcp_dummy_plugin/_cli.py | Adds dummy Typer CLI for CLI plugin registration tests. |
| tests/resources/mcp_dummy_plugin/src/mcp_dummy_plugin/init.py | Exports dummy CLI/nav builder alongside MCP entrypoint module. |
| tests/resources/mcp_dummy_plugin/pyproject.toml | Adds deps needed by the dummy plugin’s new CLI/nav modules. |
| tests/aignostics/utils/plugin_test.py | New integration tests verifying plugin discovery for CLI + GUI navigation. |
| tests/aignostics/utils/di_test.py | Fixes record_property tested-item-id references to SPEC-UTILS-SERVICE. |
| tests/aignostics/utils/TC-UTILS-PLUGIN-02.feature | BDD spec for plugin CLI command registration. |
| tests/aignostics/utils/TC-UTILS-PLUGIN-03.feature | BDD spec for plugin GUI page/nav registration. |
| specifications/SPEC-UTILS-SERVICE.md | Adds FR-11/12/13 and links spec fulfillment to new SWRs. |
| requirements/SHR-UTILS-1.md | Narrows MCP requirement scope to SDK tool access and “Developers”. |
| requirements/SHR-UTILS-2.md | New top-level plugin-system requirement. |
| requirements/SWR-UTILS-2-1.md | New SWR for plugin discovery/loading. |
| requirements/SWR-UTILS-2-2.md | New SWR for plugin CLI command integration. |
| requirements/SWR-UTILS-2-3.md | New SWR for plugin GUI page integration. |
| .pre-commit-config.yaml | Excludes tests/resources/ from name-tests-test hook. |
.pre-commit-config.yaml
Outdated
| - id: mixed-line-ending | ||
| - id: name-tests-test | ||
| exclude: "^tests/main.py" | ||
| exclude: "^tests/main.py|^tests/resources/" |
There was a problem hiding this comment.
The name-tests-test hook's exclude regex uses ^tests/main.py|^tests/resources/; the dot in main.py is a regex wildcard, so it will also match paths like tests/mainXpy. Escape the dot (e.g., main\.py) and consider grouping the alternation for clarity.
| exclude: "^tests/main.py|^tests/resources/" | |
| exclude: "^(tests/main\.py|tests/resources/)" |
| @pytest.fixture(scope="session") | ||
| def install_dummy_plugin() -> Iterator[None]: | ||
| """Install the dummy plugin and uninstall after the session.""" | ||
| import importlib | ||
| import site |
There was a problem hiding this comment.
This session-scoped fixture installs/uninstalls the same mcp-dummy-plugin distribution that is already managed by the install_dummy_mcp_plugin session fixture in tests/aignostics/utils/mcp_test.py (same tests/resources/mcp_dummy_plugin dir). Duplicating the install/uninstall work makes the suite slower and can lead to teardown-order brittleness; consider centralizing the dummy-plugin install fixture in a shared conftest.py (or otherwise reusing a single session fixture) so it runs once per test session.
Codecov Report✅ All modified and coverable lines are covered by tests. |
Escape dot in main\.py and group alternation for correctness and clarity. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ftest Move the session-scoped install_dummy_plugin fixture from plugin_test.py and mcp_test.py into a shared tests/aignostics/utils/conftest.py so the package is only installed/uninstalled once per session regardless of how many test files use it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Backslash must be doubled in YAML double-quoted strings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|



Summary
SHR-UTILS-1("Central MCP Server for SDK and Plugin Tool Access")into two focused requirements as requested in code review feedback:
SHR-UTILS-1refined to cover MCP server only (removed plugin references,changed actor from "Users" to "Developers")
SHR-UTILS-2new: "Plugin System for SDK Extension" with three child SWRs:SWR-UTILS-2-1(discovery),SWR-UTILS-2-2(CLI),SWR-UTILS-2-3(GUI)SPEC-UTILS-SERVICEto fulfil the new SWRs and adds FR-11/12/13TC-UTILS-PLUGIN-02andTC-UTILS-PLUGIN-03extended
mcp_dummy_plugintest resource (new_cli.pyand_nav.py)record_propertyreferences indi_test.pypointing tonon-existent
SPEC-UTILS-DI— corrected toSPEC-UTILS-SERVICEtests/resources/from thename-tests-testpre-commit hook(non-test source files live there as plugin fixtures)
Test plan
di_test.pyandgui_test.pycover FR-11/12/13 and passtest_plugin_cli_registeredandtest_plugin_nav_builder_registeredpass