Skip to content

add unit tests for agent_spec, source_registry, and service_registry#539

Open
iftiquar wants to merge 1 commit intoarchi-physics:mainfrom
iftiquar:tests/add-agent-spec-registry-unit-tests
Open

add unit tests for agent_spec, source_registry, and service_registry#539
iftiquar wants to merge 1 commit intoarchi-physics:mainfrom
iftiquar:tests/add-agent-spec-registry-unit-tests

Conversation

@iftiquar
Copy link
Copy Markdown

@iftiquar iftiquar commented Mar 26, 2026

Summary

  • Add 94 new unit tests covering three previously untested core modules:
    • test_agent_spec.py (41 tests): AgentSpec dataclass, frontmatter parsing (valid, empty, malformed YAML, missing fences), metadata extraction/validation (name, tools), file discovery (list_agent_files), agent selection by name (select_agent_spec), in-memory loading (load_agent_spec_from_text), and slug generation (slugify_agent_name).
    • test_source_registry.py (24 tests): default source registration (links, sso, git, jira, redmine), transitive dependency resolution (sso→links, git→links), secret and config-field aggregation, custom source registration, and error handling.
    • test_service_registry.py (29 tests): default service registration across infrastructure/application/integration categories, ServiceDefinition properties (volume/image/container naming), dependency resolution (auto-enable infrastructure, postgres pulled in by chatbot/grafana), secret aggregation, category filtering, port configuration, and custom registration.

Motivation

The project had only 8 unit test files for 128+ source modules. These three modules are foundational — agent_spec defines the agent system, source_registry manages data source dependencies, and service_registry wires deployment infrastructure — yet had zero test coverage.

Test plan

  • All 94 tests pass locally (pytest tests/unit/test_agent_spec.py tests/unit/test_source_registry.py tests/unit/test_service_registry.py -v)
  • No regressions in existing test suite
  • isort --check and black --check pass on all new files
  • No external service dependencies (tests use tmp_path fixtures and fresh registry instances)

Cover the three previously untested core modules with 94 new tests:

- test_agent_spec (41 tests): frontmatter parsing, metadata validation,
  file discovery, agent selection, in-memory loading, slugification,
  and error paths for malformed specs.
- test_source_registry (24 tests): default source registration, dependency
  resolution (transitive deps like sso->links), secret/config-field
  aggregation, custom registration, and error handling.
- test_service_registry (29 tests): default service registration across
  infrastructure/application/integration categories, ServiceDefinition
  properties (volume/image/container names), dependency resolution,
  secret aggregation, category filtering, port configuration, and
  custom registration.
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