Skip to content

feat(utils): split MCP and plugin requirements, add plugin integration tests#458

Open
omid-aignostics wants to merge 7 commits intomainfrom
feat/split-utils-requirements
Open

feat(utils): split MCP and plugin requirements, add plugin integration tests#458
omid-aignostics wants to merge 7 commits intomainfrom
feat/split-utils-requirements

Conversation

@omid-aignostics
Copy link
Collaborator

Summary

  • Splits SHR-UTILS-1 ("Central MCP Server for SDK and Plugin Tool Access")
    into two focused requirements as requested in code review feedback:
    • SHR-UTILS-1 refined to cover MCP server only (removed plugin references,
      changed actor from "Users" to "Developers")
    • SHR-UTILS-2 new: "Plugin System for SDK Extension" with three child SWRs:
      SWR-UTILS-2-1 (discovery), SWR-UTILS-2-2 (CLI), SWR-UTILS-2-3 (GUI)
  • Updates SPEC-UTILS-SERVICE to fulfil the new SWRs and adds FR-11/12/13
  • Adds feature test cases TC-UTILS-PLUGIN-02 and TC-UTILS-PLUGIN-03
  • Adds integration tests for plugin CLI and GUI registration backed by an
    extended mcp_dummy_plugin test resource (new _cli.py and _nav.py)
  • Fixes 13 record_property references in di_test.py pointing to
    non-existent SPEC-UTILS-DI — corrected to SPEC-UTILS-SERVICE
  • Excludes tests/resources/ from the name-tests-test pre-commit hook
    (non-test source files live there as plugin fixtures)

Test plan

  • Unit tests in di_test.py and gui_test.py cover FR-11/12/13 and pass
  • New integration tests test_plugin_cli_registered and
    test_plugin_nav_builder_registered pass
  • Pre-commit hooks pass on push

omid-aignostics and others added 2 commits March 4, 2026 17:22
…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>
Copilot AI review requested due to automatic review settings March 4, 2026 16:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 updated SPEC-UTILS-SERVICE to include FR-11/12/13.
  • Extended the mcp_dummy_plugin test 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_property IDs in di_test.py; updated pre-commit exclusions for tests/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.

- id: mixed-line-ending
- id: name-tests-test
exclude: "^tests/main.py"
exclude: "^tests/main.py|^tests/resources/"
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
exclude: "^tests/main.py|^tests/resources/"
exclude: "^(tests/main\.py|tests/resources/)"

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +33
@pytest.fixture(scope="session")
def install_dummy_plugin() -> Iterator[None]:
"""Install the dummy plugin and uninstall after the session."""
import importlib
import site
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 9 files with indirect coverage changes

omid-aignostics and others added 5 commits March 4, 2026 19:06
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>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

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.

2 participants