add unit tests for agent_spec, source_registry, and service_registry#539
Open
iftiquar wants to merge 1 commit intoarchi-physics:mainfrom
Open
add unit tests for agent_spec, source_registry, and service_registry#539iftiquar wants to merge 1 commit intoarchi-physics:mainfrom
iftiquar wants to merge 1 commit intoarchi-physics:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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,ServiceDefinitionproperties (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
pytest tests/unit/test_agent_spec.py tests/unit/test_source_registry.py tests/unit/test_service_registry.py -v)isort --checkandblack --checkpass on all new filestmp_pathfixtures and fresh registry instances)