Skip to content

Created comprehensive test coverage in req_filter_tools_test.go with …#848

Merged
rootfs merged 5 commits into
vllm-project:mainfrom
szedan-rh:test_tools
Dec 18, 2025
Merged

Created comprehensive test coverage in req_filter_tools_test.go with …#848
rootfs merged 5 commits into
vllm-project:mainfrom
szedan-rh:test_tools

Conversation

@szedan-rh
Copy link
Copy Markdown
Collaborator

Created comprehensive test coverage in req_filter_tools_test.go with 27 test cases covering:

  1. Tools Database Loading - Loading from file, error handling for missing/invalid files
  2. Top-K Tool Selection - Testing topK=1, 2, 3 and constraints
  3. Similarity Threshold Filtering - Testing different threshold values (0.2, 0.5, 0.7, 0.99)
  4. Fallback Strategy - Testing fallbackToEmpty true/false scenarios
  5. Tool Selection Integration - Verifying correct tools selected for weather, math, search, email queries
  6. Request Processing - Testing tool_choice=auto requirement and edge cases
  7. Category/Tag-Based Filtering - Testing semantic matching across categories

Fixes Applied

  1. Updated CreateTestRouter (extproc_test.go:577-595) to:
    - Use tools-specific similarity threshold from config
    - Load tools from database file when enabled
    - Properly initialize ToolsDatabase with correct configuration

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 16, 2025

Deploy Preview for vllm-semantic-router ready!

Name Link
🔨 Latest commit 4b64788
🔍 Latest deploy log https://app.netlify.com/projects/vllm-semantic-router/deploys/6943f9256e80710008f41d34
😎 Deploy Preview https://deploy-preview-848--vllm-semantic-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 16, 2025

👥 vLLM Semantic Team Notification

The following members have been identified for the changed files in this PR and have been automatically assigned:

📁 src

Owners: @rootfs, @Xunzhuo, @wangchen615
Files changed:

  • src/semantic-router/pkg/extproc/extproc_test.go
  • src/semantic-router/pkg/extproc/req_filter_tools_test.go

vLLM

🎉 Thanks for your contributions!

This comment was automatically generated based on the OWNER files in the repository.

…27 test cases covering

Signed-off-by: Senan Zedan <szedan@redhat.com>
- Fixed err shadowing in extproc_test.go by renaming to loadErr
- Fixed router shadowing in req_filter_tools_test.go by using testRouter
- All pre-commit checks now pass

Signed-off-by: Senan Zedan <szedan@redhat.com>
- Changed CreateTestConfig to use all-MiniLM-L6-v2 instead of L12-v2
- This matches the model initialized in tool selection test BeforeEach
- Prevents singleton initialization conflicts that cause embedding generation to fail

Signed-off-by: Senan Zedan <szedan@redhat.com>
Signed-off-by: Senan Zedan <szedan@redhat.com>
The 'Similarity Threshold Filtering' tests were modifying
cfg.ToolSelection.Tools.SimilarityThreshold after the router was already
created in BeforeEach. This caused the tests to use the default threshold
(0.2) instead of the test-specific thresholds (0.7, 0.99, 0.5).

The fix recreates the router after setting the new threshold value in each
test, ensuring the ToolsDatabase is initialized with the correct threshold.

This fixes the failing test:
- 'should return empty list when no tools meet high threshold'

And prevents similar issues in three other tests in the same describe block.

Signed-off-by: Senan Zedan <szedan@redhat.com>
@szedan-rh
Copy link
Copy Markdown
Collaborator Author

@rootfs / @Xunzhuo - Could you please review?

@rootfs rootfs merged commit 12ea0d6 into vllm-project:main Dec 18, 2025
35 of 37 checks passed
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.

4 participants