test: add test suite and CI workflow (71 tests)#206
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
… search tools MCP server (server.py): - Shared _search_collection helper for all Milvus queries - search_github_issues: semantic search over GitHub issues with repo/state filters - search_kubeflow_code: semantic search over YAML manifests and Python source - Lazy initialization of SentenceTransformer and MilvusClient Ingestion pipelines: - issues-pipeline.py: KFP pipeline for GitHub issues with comment-boundary chunking - issues_utils.py: metadata parsing and chunking logic (testable outside KFP) - code-pipeline.py: KFP pipeline with YAML-aware and Python AST-aware chunking - code_utils.py: file routing, YAML document splitting, AST parsing - utils.py: shared clean_content() for Hugo/HTML doc preprocessing Agent CRD (setup.yaml): - All 3 tools wired to kubeflow-docs-mcp RemoteMCPServer - Updated systemMessage with multi-tool routing strategy Scripts: - index_real_issues.py: standalone GitHub issues indexing script Misc: - Add .claude/ to .gitignore Signed-off-by: Rohit Kumar <rr7433446@gmail.com>
Test modules: - test_mcp_server.py: MCP tool contracts, _search_collection, _init() idempotency - test_pipeline_utils.py: clean_content() Hugo/HTML preprocessing edge cases - test_issues_pipeline.py: issue metadata parsing, comment-boundary chunking Infrastructure: - conftest.py: shared fixtures (mock MilvusClient, SentenceTransformer, sample hits) - .github/workflows/tests.yml: pytest on Python 3.9, 3.11, 3.12 - requirements-test.txt: test dependencies (pytest, numpy) All 71 tests pass. Heavy deps (pymilvus, sentence_transformers) are mocked at import time to keep tests fast (<4s) with no GPU/model downloads needed. Signed-off-by: Rohit Kumar <rr7433446@gmail.com>
Add lean CI gates and behavior-focused tests for active MCP and code-ingestion paths so first PR validation is useful without publishing or deployment automation.
Allow the lean CI workflow to run on feat/test-infra so fork PRs can exercise the test suite before targeting main.
Run the first PR safety pytest job on Python 3.11 because FastMCP does not publish Python 3.9 wheels.
Use standard per-file ignore table syntax so pytest and other TOML readers can parse pyproject.toml in CI.
ArshVermaGit
left a comment
There was a problem hiding this comment.
Really solid test coverage overall — the scope feels well balanced across MCP tooling, pipeline utilities, and issue processing, and I like that the tests stay fast by mocking heavy dependencies at import time instead of relying on real model downloads or external services. The CI setup across multiple Python versions is also a nice touch and should help catch compatibility issues early. The coverage around edge cases in clean_content() and chunking/metadata handling especially stands out since those tend to be areas where regressions quietly slip in. Given the passing local + CI runs and the isolated test design, this looks in great shape to merge once #205 lands.
Summary
Test coverage
test_mcp_server.py_search_collectionhelper,_init()idempotency, filter paramstest_pipeline_utils.pyclean_content()— Hugo frontmatter, HTML tags, template syntax, edge casestest_issues_pipeline.pyparse_issue_metadata,build_metadata_prefix,split_issue_into_chunksFiles added
tests/conftest.py— shared fixtures (mock MilvusClient, SentenceTransformer, sample Milvus hits)tests/test_mcp_server.py,tests/test_pipeline_utils.py,tests/test_issues_pipeline.py.github/workflows/tests.yml— CI workflowrequirements-test.txt— test dependenciesDepends on #205 for the feature code being tested.
Test plan
python -m pytest tests/ -vpasses locally (71/71)