Skip to content

test: add unit tests for server application#173

Open
Aniketh-74 wants to merge 1 commit intokubeflow:mainfrom
Aniketh-74:test/add-server-unit-tests
Open

test: add unit tests for server application#173
Aniketh-74 wants to merge 1 commit intokubeflow:mainfrom
Aniketh-74:test/add-server-unit-tests

Conversation

@Aniketh-74
Copy link
Copy Markdown

Addresses #44

Adds a comprehensive test suite for server/app.py with 30 test cases:

  • MilvusSearchClient (7 tests): lazy init, connection reuse,
    encoder caching, error recovery, result formatting, similarity
    calculation, content truncation
  • execute_tool (5 tests): known/unknown tools, malformed args,
    empty results, citation deduplication
  • health_check (3 tests): /health endpoint, non-health paths
  • TOOLS config (3 tests): structure, required params, bounds
  • SYSTEM_PROMPT (4 tests): content validation
  • Message parsing (4 tests): JSON, plain text, bytes, edge cases
  • Config (4 tests): default env variable values

All tests use unittest.mock — no Milvus, KServe, or LLM required.

Run: python -m pytest server/tests/test_app.py -v

Adds comprehensive test suite for server/app.py with 30 test cases.
All tests use mocking - no external services required.

Run with: python -m pytest server/tests/test_app.py -v

Signed-off-by: Aniketh Mahadik <anikethani32@gmail.com>
@google-oss-prow
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign franciscojavierarceo for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant